reactjs-signal 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import {signal,computed,effect,effectScope,unstable}from'alien-signals';import {useSyncExternalStore,useEffect,useMemo,useState}from'react';function g(e){return signal(e)}function m(e){return computed(e)}function x(e){return effect(e)}function b(){return effectScope()}function E(e){return unstable.asyncComputed(e)}async function I(e){return await unstable.asyncEffect(e).run()}function V(e,t){return unstable.computedArray(e,t)}function C(e){return unstable.computedSet(e)}function v(e){return unstable.equalityComputed(e)}function A(e){return [useSyncExternalStore(n=>{let c=effect(()=>{e.get(),n();});return ()=>c.stop()},()=>e.get(),()=>e.get()),n=>{typeof n=="function"?e.set(n(e.get())):e.set(n);}]}function _(e){return useSyncExternalStore(t=>{let o=effect(()=>{e.get(),t();});return ()=>o.stop()},()=>e.get())}function W(e){return t=>{typeof t=="function"?e.set(t(e.get())):e.set(t);}}function D(e){useEffect(()=>{let t=effect(e);return ()=>t.stop()},[e]);}function O(){let e=useMemo(()=>effectScope(),[]);return useEffect(()=>()=>{e.stop();},[e]),e}function G(e){let[t,o]=useState(e.currentValue);return useSyncExternalStore(n=>{let c=effect(()=>{e.currentValue,n();});return ()=>c.stop()},()=>e.currentValue),useEffect(()=>{let n=!0;return (async()=>{let l=await e.get();n&&o(l);})(),()=>{n=!1;}},[e]),t}function P(e){useEffect(()=>{let t=unstable.asyncEffect(e);return ()=>t.stop()},[e]);}export{m as createComputed,x as createEffect,g as createSignal,b as createSignalScope,E as unstable_createAsyncComputed,I as unstable_createAsyncEffect,V as unstable_createComputedArray,C as unstable_createComputedSet,v as unstable_createEqualityComputed,G as unstable_useAsyncComputedValue,P as unstable_useAsyncEffect,W as useSetSignal,A as useSignal,D as useSignalEffect,O as useSignalScope,_ as useSignalValue};
1
+ import {signal,computed,effect,effectScope,unstable}from'alien-signals';import {useSyncExternalStore,useEffect,useMemo,useState}from'react';function g(e){return signal(e)}function m(e){return computed(e)}function x(e){return effect(e)}function b(){return effectScope()}function E(e){return unstable.asyncComputed(e)}async function I(e){return await unstable.asyncEffect(e).run()}function V(e,t){return unstable.computedArray(e,t)}function C(e){return unstable.computedSet(e)}function v(e){return unstable.equalityComputed(e)}function A(e){return [useSyncExternalStore(n=>{let c=effect(()=>{e.get(),n();});return ()=>c.stop()},()=>e.get(),()=>e.get()),n=>{typeof n=="function"?e.set(n(e.get())):e.set(n);}]}function _(e){return useSyncExternalStore(t=>{let o=effect(()=>{e.get(),t();});return ()=>o.stop()},()=>e.get(),()=>e.get())}function W(e){return t=>{typeof t=="function"?e.set(t(e.get())):e.set(t);}}function D(e){useEffect(()=>{let t=effect(e);return ()=>t.stop()},[e]);}function O(){let e=useMemo(()=>effectScope(),[]);return useEffect(()=>()=>{e.stop();},[e]),e}function G(e){let[t,o]=useState(e.currentValue);return useSyncExternalStore(n=>{let c=effect(()=>{e.currentValue,n();});return ()=>c.stop()},()=>e.currentValue),useEffect(()=>{let n=!0;return (async()=>{let p=await e.get();n&&o(p);})(),()=>{n=!1;}},[e]),t}function P(e){useEffect(()=>{let t=unstable.asyncEffect(e);return ()=>t.stop()},[e]);}export{m as createComputed,x as createEffect,g as createSignal,b as createSignalScope,E as unstable_createAsyncComputed,I as unstable_createAsyncEffect,V as unstable_createComputedArray,C as unstable_createComputedSet,v as unstable_createEqualityComputed,G as unstable_useAsyncComputedValue,P as unstable_useAsyncEffect,W as useSetSignal,A as useSignal,D as useSignalEffect,O as useSignalScope,_ as useSignalValue};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactjs-signal",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",