Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1b8b573

Browse files
committed
Update Object.js
1 parent ddd916f commit 1b8b573

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/Object.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ module.factory('BaseObject', ($q) => {
3232
*/
3333
cache(name, callback, permanent = false) {
3434
// sets (truthy) flag reference to promise + avoids redundant calls
35-
return this[name] || this[name] = callback()
35+
return this[name] || ( this[name] = callback()
3636
// flag cleanup (doesn't affect chaining)
3737
.finally( () => {
3838
if (!permanent)
3939
this[name] = null;
40-
});
40+
})
41+
);
4142
}
4243

4344
/**

0 commit comments

Comments
 (0)