UNPKG

@instantdb/core

Version:

Instant's core local abstraction

21 lines (17 loc) 305 B
export class Deferred { promise; _resolve; _reject; constructor() { this.promise = new Promise((resolve, reject) => { this._resolve = resolve; this._reject = reject; }); } resolve(value) { this._resolve(value); } reject(reason) { this._reject(reason); } }