MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / callOnce

Function callOnce

web/static/bower_components/angular/angular.js:14669–14680  ·  view source on GitHub ↗
(self, resolveFn, rejectFn)

Source from the content-addressed store, hash-verified

14667function qFactory(nextTick, exceptionHandler) {
14668 var $qMinErr = minErr('$q', TypeError);
14669 function callOnce(self, resolveFn, rejectFn) {
14670 var called = false;
14671 function wrap(fn) {
14672 return function(value) {
14673 if (called) return;
14674 called = true;
14675 fn.call(self, value);
14676 };
14677 }
14678
14679 return [wrap(resolveFn), wrap(rejectFn)];
14680 }
14681
14682 /**
14683 * @ngdoc method

Callers 1

qFactoryFunction · 0.85

Calls 1

wrapFunction · 0.85

Tested by

no test coverage detected