UNPKG

@zedux/stores

Version:

The legacy composable store model of Zedux

38 lines (37 loc) 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AtomApi = void 0; const core_1 = require("@zedux/core"); const atoms_port_1 = require("./atoms-port"); class AtomApi { constructor(value) { this.promise = undefined; this.value = value; this.store = ((0, core_1.is)(value, core_1.Store) ? value : undefined); if ((0, core_1.is)(value, AtomApi)) { Object.assign(this, value); } } addExports(exports) { if (!this.exports) this.exports = exports; else this.exports = Object.assign(Object.assign({}, this.exports), exports); return this; } setExports(exports) { ; this.exports = exports; return this; // for chaining } setPromise(promise) { this.promise = promise; return this; // for chaining } setTtl(ttl) { this.ttl = ttl; return this; // for chaining } } exports.AtomApi = AtomApi; AtomApi.$$typeof = Symbol.for(`${atoms_port_1.prefix}/AtomApi`);