@zedux/stores
Version:
The legacy composable store model of Zedux
21 lines (20 loc) • 714 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.api = void 0;
const AtomApi_1 = require("./AtomApi");
/**
* Create an AtomApi
*
* AtomApis are the standard mechanism for passing stores, exports, and promises
* around.
*
* An AtomApi that's returned from an atom state factory becomes _the_ api of
* the atom.
*
* - Any exports on the AtomApi are set as the atom instance's exports on
* initial evaluation and ignored forever after.
* - If promise or state references change on subsequent evaluations, it
* triggers the appropriate updates in all the atom's dynamic dependents.
*/
const api = (value) => new AtomApi_1.AtomApi(value);
exports.api = api;