Function
callOnce
(self, resolveFn, rejectFn)
Source from the content-addressed store, hash-verified
| 15044 | function qFactory(nextTick, exceptionHandler) { |
| 15045 | var $qMinErr = minErr('$q', TypeError); |
| 15046 | function callOnce(self, resolveFn, rejectFn) { |
| 15047 | var called = false; |
| 15048 | function wrap(fn) { |
| 15049 | return function(value) { |
| 15050 | if (called) return; |
| 15051 | called = true; |
| 15052 | fn.call(self, value); |
| 15053 | }; |
| 15054 | } |
| 15055 | |
| 15056 | return [wrap(resolveFn), wrap(rejectFn)]; |
| 15057 | } |
| 15058 | |
| 15059 | /** |
| 15060 | * @ngdoc method |
Tested by
no test coverage detected