Function
callOnce
(self, resolveFn, rejectFn)
Source from the content-addressed store, hash-verified
| 13062 | function qFactory(nextTick, exceptionHandler) { |
| 13063 | var $qMinErr = minErr('$q', TypeError); |
| 13064 | function callOnce(self, resolveFn, rejectFn) { |
| 13065 | var called = false; |
| 13066 | function wrap(fn) { |
| 13067 | return function(value) { |
| 13068 | if (called) return; |
| 13069 | called = true; |
| 13070 | fn.call(self, value); |
| 13071 | }; |
| 13072 | } |
| 13073 | |
| 13074 | return [wrap(resolveFn), wrap(rejectFn)]; |
| 13075 | } |
| 13076 | |
| 13077 | /** |
| 13078 | * @ngdoc method |
Tested by
no test coverage detected