UNPKG

548 BJavaScriptView Raw
1!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jotai")):"function"==typeof define&&define.amd?define(["exports","jotai"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jotaiRedux={},t.jotai)}(this,(function(t,e){"use strict";t.atomWithStore=function(t){var o=e.atom(t.getState());return o.onMount=function(e){var o=function(){e(t.getState())},n=t.subscribe(o);return o(),n},e.atom((function(t){return t(o)}),(function(e,o,n){t.dispatch(n)}))},Object.defineProperty(t,"__esModule",{value:!0})}));