MCPcopy
hub / github.com/cujojs/when / attempt

Function attempt

when.js:121–127  ·  view source on GitHub ↗

* Call f in a future turn, with the supplied args, and return a promise * for the result. * @param {function} f * @returns {Promise}

(f /*, args... */)

Source from the content-addressed store, hash-verified

119 * @returns {Promise}
120 */
121 function attempt(f /*, args... */) {
122 /*jshint validthis:true */
123 for(var i=0, l=arguments.length-1, a=new Array(l); i<l; ++i) {
124 a[i] = arguments[i+1];
125 }
126 return apply(f, this, a);
127 }
128
129 /**
130 * Creates a {promise, resolver} pair, either or both of which

Callers 1

scheduleFunction · 0.85

Calls 1

applyFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…