Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 2c001c5

Browse files
committed
Update Object.js
1 parent b267cc8 commit 2c001c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/Object.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ module.factory('BaseObject', ($q) => {
3131
* @param {boolean} [permanent] If the cache should be removed upon completion (default:false)
3232
*/
3333
cache(name, callback, permanent = false) {
34-
// sets (truthy) flag reference to promise + avoids redundant calls
34+
// if promise already present (in progress) then return it instead
3535
if (this[name])
3636
return this[name];
3737

38+
// sets (truthy) flag reference to promise + avoids redundant calls
3839
return this[name] = callback()
3940
// flag cleanup (doesn't affect chaining)
4041
.finally( () => {

0 commit comments

Comments
 (0)