1 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("jotai-tanstack-query"),require("jotai")):"function"==typeof define&&define.amd?define(["exports","jotai-tanstack-query","jotai"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).jotaiQuery={},e.jotaiTanstackQuery,e.jotai)}(this,(function(e,t,n){"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}Object.defineProperty(e,"queryClientAtom",{enumerable:!0,get:function(){return t.queryClientAtom}}),e.atomWithInfiniteQuery=function(e,o){void 0===o&&(o=function(e){return e(t.queryClientAtom)});var i=function(t){return r({staleTime:200},"function"==typeof e?e(t):e)},u=t.atomsWithInfiniteQuery(i,o)[0];return n.atom((function(e){var t=i(e);return!1===t.enabled?o(e).getQueryData(t.queryKey):e(u)}),(function(e,t,n){return"refetch"===n.type?t(u,{type:"refetch",force:!0,options:n.payload}):t(u,n)}))},e.atomWithQuery=function(e,o){void 0===o&&(o=function(e){return e(t.queryClientAtom)});var i=function(t){return r({staleTime:200},"function"==typeof e?e(t):e)},u=t.atomsWithQuery(i,o)[0];return n.atom((function(e){var t=i(e);return!1===t.enabled?o(e).getQueryData(t.queryKey):e(u)}),(function(e,t,n){if("refetch"===n.type)return t(u,{type:"refetch",force:!0})}))}}));
|