MCPcopy Create free account
hub / github.com/WebDevSimplified/js-promise-library / constructor

Method constructor

MyPromise.js:15–21  ·  view source on GitHub ↗
(cb)

Source from the content-addressed store, hash-verified

13 #onFailBind = this.#onFail.bind(this)
14
15 constructor(cb) {
16 try {
17 cb(this.#onSuccessBind, this.#onFailBind)
18 } catch (e) {
19 this.#onFail(e)
20 }
21 }
22
23 #runCallbacks() {
24 if (this.#state === STATE.FULFILLED) {

Callers

nothing calls this directly

Calls 1

#onFailMethod · 0.95

Tested by

no test coverage detected