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

Function wrap

web/static/bower_components/angular/angular.js:14671–14677  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

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 }

Callers 1

callOnceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected