MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / resolve

Function resolve

libraries/p5.js:222–233  ·  view source on GitHub ↗

`Promise.resolve` returns a promise that will become resolved with the passed `value`. It is shorthand for the following: ```javascript let promise = new Promise(function(resolve, reject){ resolve(1); }); promise.then(function(value){ // value === 1 }); ``` Instead of writ

(object)

Source from the content-addressed store, hash-verified

220 `value`
221*/
222function resolve(object) {
223 /*jshint validthis:true */
224 var Constructor = this;
225
226 if (object && typeof object === 'object' && object.constructor === Constructor) {
227 return object;
228 }
229
230 var promise = new Constructor(noop);
231 _resolve(promise, object);
232 return promise;
233}
234
235var PROMISE_ID = Math.random().toString(36).substring(16);
236

Callers 3

fetchJsonpFunction · 0.85
fileReaderReadyFunction · 0.85
p5.jsFile · 0.85

Calls 1

_resolveFunction · 0.85

Tested by

no test coverage detected