Sha256: 50ed2fcb890e9f65d5a3bb2c96a3032241a4e635bc0116165962b1a9e0ce1dbf
Contents?: true
Size: 464 Bytes
Versions: 94
Compression:
Stored size: 464 Bytes
Contents
export function emptyPromise() { let res; let rej; const p = new Promise((resolve, reject) => { res = resolve; rej = reject; }); p.pending = true; p.resolved = p.rejected = null; p.resolve = (...args) => { res(...args); p.resolved = true; p.rejected = false; p.pending = false; }; p.reject = (...args) => { rej(...args); p.rejected = true; p.resolved = false; p.pending = false; }; return p; }
Version data entries
94 entries across 94 versions & 4 rubygems