@zedux/atoms
Version:
A Molecular State Engine for React
38 lines (37 loc) • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AtomApi = void 0;
const core_1 = require("@zedux/core");
const general_1 = require("../utils/general");
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(`${general_1.prefix}/AtomApi`);