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

Function Promise

libraries/p5.js:873–882  ·  view source on GitHub ↗

Promise objects represent the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the reason why the promise cannot be fulfilled. Terminology ---

(resolver)

Source from the content-addressed store, hash-verified

871 @constructor
872*/
873function Promise(resolver) {
874 this[PROMISE_ID] = nextId();
875 this._result = this._state = undefined;
876 this._subscribers = [];
877
878 if (noop !== resolver) {
879 typeof resolver !== 'function' && needsResolver();
880 this instanceof Promise ? initializePromise(this, resolver) : needsNew();
881 }
882}
883
884Promise.all = all;
885Promise.race = race;

Callers

nothing calls this directly

Calls 4

nextIdFunction · 0.85
needsResolverFunction · 0.85
initializePromiseFunction · 0.85
needsNewFunction · 0.85

Tested by

no test coverage detected