@rkrupinski/stan 1.0.0-rc7 → 1.0.0-rc9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e,R as t,d as s}from"./utils-BY8H9TPH.js";export{r as refresh}from"./utils-BY8H9TPH.js";class c{#e;#t;constructor(e){this.#e=new Map,this.#t=e}#s(){const e=this.#e.keys().next().value;void 0!==e&&this.#e.delete(e)}has(e){return this.#e.has(e)}get(e){if(!this.has(e))return;const t=this.#e.get(e);return this.#e.delete(e),this.#e.set(e,t),t}set(e,t){this.#e.has(e)?this.#e.delete(e):this.#e.size>=this.#t&&this.#s(),this.#e.set(e,t)}delete(e){return this.#e.delete(e)}clear(){this.#e.clear()}}class a extends Map{}const n=e=>{switch(e.type){case"keep-all":return new a;case"most-recent":return new c(1);case"lru":return new c(e.maxSize);default:return e}},h=(e,{effects:t}={})=>{let s=!1,c=e;const a=new Set,r=e=>{c=
|
|
1
|
+
import{s as e,R as t,d as s}from"./utils-BY8H9TPH.js";export{r as refresh}from"./utils-BY8H9TPH.js";class c{#e;#t;constructor(e){this.#e=new Map,this.#t=e}#s(){const e=this.#e.keys().next().value;void 0!==e&&this.#e.delete(e)}has(e){return this.#e.has(e)}get(e){if(!this.has(e))return;const t=this.#e.get(e);return this.#e.delete(e),this.#e.set(e,t),t}set(e,t){this.#e.has(e)?this.#e.delete(e):this.#e.size>=this.#t&&this.#s(),this.#e.set(e,t)}delete(e){return this.#e.delete(e)}clear(){this.#e.clear()}}class a extends Map{}const n=e=>{switch(e.type){case"keep-all":return new a;case"most-recent":return new c(1);case"lru":return new c(e.maxSize);default:return e}},h=(e,{effects:t}={})=>{let s=!1,c=e;const a=new Set,r=new Set,n=(e=!1)=>t=>{c=t instanceof Function?t(c):t,a.forEach((e=>e(c))),e||r.forEach((e=>e(c)))};return t?.forEach((e=>e({init(e){s||(c=e)},set:n(!0),onSet(e){r.add(e)}}))),s=!0,{get:()=>c,set:n(),subscribe:e=>(a.add(e),()=>{a.delete(e)})}},i=(t,s)=>{const c=n({type:"keep-all"});return a=>{const r=e(a);return c.has(r)||c.set(r,h(t instanceof Function?t(a):t,s)),c.get(r)}},l=(e,{areValuesEqual:c=s}={})=>{let a,r=!1,n=!1;const h=new Set,i=new Set,l=new Set,u=e=>{let t=e.get();if(!i.has(e)){i.add(e);const s=e.subscribe((e=>{c(t,e)||(t=e,o(),d())}));l.add(s)}return t},o=()=>{a=e({get:u})},d=()=>{h.forEach((e=>e(a)))};return{get:()=>(r||(r=!0,o()),a),subscribe:e=>(0===h.size&&(n=!0),h.add(e),function(){h.delete(e),0===h.size&&(n=!1,l.forEach((e=>e())),l.clear(),i.clear())}),[t](){n?(o(),d()):r=!1}}},u=(t,{areValuesEqual:c=s,cachePolicy:a={type:"keep-all"}}={})=>{const r=n(a);return s=>{const a=e(s);return r.has(a)||r.set(a,l(t(s),{areValuesEqual:c})),r.get(a)}};export{h as atom,i as atomFamily,l as selector,u as selectorFamily};
|