UNPKG

jotai

Version:

👻 Primitive and flexible state management for React

2 lines (1 loc) • 712 B
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("jotai/vanilla/internals")):"function"==typeof define&&define.amd?define(["exports","jotai/vanilla/internals"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).jotaiVanilla={},t.jotaiVanillaInternals)}(this,(function(t,n){"use strict";var e,i=0;function o(t){return t(this)}function r(t,n,e){return n(this,"function"==typeof e?e(t(this)):e)}function a(){return n.INTERNAL_buildStoreRev1()}t.atom=function(t,n){var e="atom"+ ++i,a={toString:function(){return e}};return"function"==typeof t?a.read=t:(a.init=t,a.read=o,a.write=r),n&&(a.write=n),a},t.createStore=a,t.getDefaultStore=function(){return e||(e=a()),e}}));