chrono-state-z 2.0.1 → 2.1.0
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/README.md +52 -25
- package/build/core/asyncAtom.d.ts +1 -1
- package/build/core/asyncComputed.d.ts +1 -1
- package/build/core/createStore.d.ts +2 -10
- package/build/core/index.d.ts +2 -6
- package/build/core/selector.d.ts +7 -1
- package/build/core/store.d.ts +6 -3
- package/build/index.cjs.js +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.esm.js +1 -1
- package/build/react/index.d.ts +3 -2
- package/build/react/useStoreSelector.d.ts +2 -2
- package/package.json +8 -8
- package/build/core/scope.d.ts +0 -4
- package/build/core/testRuntime.d.ts +0 -6
- package/build/react/useScopedStore.d.ts +0 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ⏱️ chrono-state-z
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/chrono-state-z) 
|
|
4
4
|
|
|
@@ -6,11 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
**chrono-state-z** is a **reactive, intent-first state runtime**
|
|
10
|
-
designed to keep **business logic outside React**.
|
|
9
|
+
**chrono-state-z** is a **reactive, intent-first state runtime** designed to keep **business logic outside React**.
|
|
11
10
|
|
|
12
|
-
It provides **atoms, computed values, async state, effects, scheduling**,
|
|
13
|
-
with a **headless core** and **thin React bindings**.
|
|
11
|
+
It provides **atoms, computed values, async state, effects, scheduling**, with a **headless core** and **thin React bindings**.
|
|
14
12
|
|
|
15
13
|
> **React renders state. Logic lives elsewhere.**
|
|
16
14
|
|
|
@@ -43,7 +41,7 @@ Use chrono-state-z when you need:
|
|
|
43
41
|
## 📦 Installation
|
|
44
42
|
|
|
45
43
|
```bash
|
|
46
|
-
npm install react ## for react
|
|
44
|
+
# npm install react ## for react
|
|
47
45
|
npm install intentx-core-z chrono-state-z
|
|
48
46
|
```
|
|
49
47
|
|
|
@@ -208,7 +206,7 @@ import { computed, useComputed } from 'chrono-state-z'
|
|
|
208
206
|
const total = computed(() => price() * qty())
|
|
209
207
|
|
|
210
208
|
function TotalView() {
|
|
211
|
-
const value = useComputed(
|
|
209
|
+
const value = useComputed(total)
|
|
212
210
|
return <div>Total: {value}</div>
|
|
213
211
|
}
|
|
214
212
|
```
|
|
@@ -218,8 +216,7 @@ function TotalView() {
|
|
|
218
216
|
### useAtomSelector
|
|
219
217
|
|
|
220
218
|
```tsx
|
|
221
|
-
|
|
222
|
-
|
|
219
|
+
// atom() returns a callable reactive value
|
|
223
220
|
const user = atom({ id: 1, name: 'Alice', age: 20 })
|
|
224
221
|
|
|
225
222
|
function Username() {
|
|
@@ -234,11 +231,13 @@ function Username() {
|
|
|
234
231
|
|
|
235
232
|
```tsx
|
|
236
233
|
import { useStore } from 'chrono-state-z'
|
|
234
|
+
import type { Store } from 'chrono-state-z'
|
|
237
235
|
|
|
238
|
-
function StoreView({ store }) {
|
|
236
|
+
function StoreView({ store }: { store: Store<any> }) {
|
|
239
237
|
const state = useStore(store)
|
|
240
|
-
return <pre>{JSON.stringify(state)}</pre>
|
|
238
|
+
return <pre>{JSON.stringify(state, null, 2)}</pre>
|
|
241
239
|
}
|
|
240
|
+
|
|
242
241
|
```
|
|
243
242
|
|
|
244
243
|
---
|
|
@@ -246,13 +245,22 @@ function StoreView({ store }) {
|
|
|
246
245
|
### useStoreSelector
|
|
247
246
|
|
|
248
247
|
```tsx
|
|
248
|
+
// Only re-renders when saving changes, not the whole store.
|
|
249
249
|
import { useStoreSelector } from 'chrono-state-z'
|
|
250
250
|
|
|
251
251
|
function SavingBadge({ store }) {
|
|
252
252
|
const saving = useStoreSelector(store, s => s.saving)
|
|
253
|
+
// const saving = useStoreSelector(
|
|
254
|
+
// store,
|
|
255
|
+
// s => s.meta,
|
|
256
|
+
// shallowEqual
|
|
257
|
+
// )
|
|
253
258
|
return saving ? 'Saving...' : 'Idle'
|
|
254
259
|
}
|
|
260
|
+
|
|
255
261
|
```
|
|
262
|
+
- `selector` should be pure and stable.
|
|
263
|
+
- If you need dynamic selection, memoize the selector.
|
|
256
264
|
|
|
257
265
|
---
|
|
258
266
|
|
|
@@ -261,28 +269,46 @@ function SavingBadge({ store }) {
|
|
|
261
269
|
```ts
|
|
262
270
|
import { useWatch } from 'chrono-state-z'
|
|
263
271
|
|
|
264
|
-
|
|
265
|
-
(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
)
|
|
272
|
+
function AuthGuard() {
|
|
273
|
+
useWatch(
|
|
274
|
+
() => user(),
|
|
275
|
+
(u) => {
|
|
276
|
+
if (u?.role === 'admin') {
|
|
277
|
+
redirect('/admin')
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
)
|
|
281
|
+
|
|
282
|
+
return null
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### AsyncAtom
|
|
288
|
+
```ts
|
|
289
|
+
const user = asyncAtom(fetchUser)
|
|
290
|
+
|
|
291
|
+
// load explicitly
|
|
292
|
+
await user.load()
|
|
293
|
+
|
|
294
|
+
// read value (throws / suspends if not ready)
|
|
295
|
+
const u = user()
|
|
270
296
|
```
|
|
271
297
|
|
|
272
298
|
---
|
|
273
299
|
|
|
274
|
-
## 🧩 Architecture
|
|
300
|
+
## 🧩 Architecture Pattern
|
|
275
301
|
|
|
276
302
|
```ts
|
|
277
303
|
import { asyncAtom, computed } from 'chrono-state-z'
|
|
278
304
|
|
|
279
305
|
export function createUserLogic() {
|
|
280
306
|
const user = asyncAtom(fetchUser)
|
|
281
|
-
const
|
|
307
|
+
const name = computed(() => user()?.name ?? 'Guest')
|
|
282
308
|
|
|
283
309
|
return {
|
|
284
310
|
user,
|
|
285
|
-
|
|
311
|
+
name,
|
|
286
312
|
reload: () => user.invalidate()
|
|
287
313
|
}
|
|
288
314
|
}
|
|
@@ -291,15 +317,16 @@ export function createUserLogic() {
|
|
|
291
317
|
```tsx
|
|
292
318
|
function UserView({ logic }) {
|
|
293
319
|
const user = useAtom(logic.user)
|
|
294
|
-
const name = useComputed(() => logic.
|
|
320
|
+
const name = useComputed(() => logic.name())
|
|
295
321
|
|
|
296
322
|
return (
|
|
297
|
-
|
|
298
|
-
<
|
|
323
|
+
<>
|
|
324
|
+
<div>Hello {name}</div>
|
|
299
325
|
<button onClick={logic.reload}>Reload</button>
|
|
300
|
-
|
|
326
|
+
</>
|
|
301
327
|
)
|
|
302
328
|
}
|
|
329
|
+
|
|
303
330
|
```
|
|
304
331
|
|
|
305
332
|
---
|
|
@@ -337,4 +364,4 @@ function UserView({ logic }) {
|
|
|
337
364
|
|
|
338
365
|
## 📜 License
|
|
339
366
|
|
|
340
|
-
MIT
|
|
367
|
+
MIT
|
|
@@ -3,4 +3,4 @@ export type AsyncComputed<T> = {
|
|
|
3
3
|
(): T;
|
|
4
4
|
invalidate(p?: Priority): void;
|
|
5
5
|
};
|
|
6
|
-
export declare function asyncComputed<T>(getter: () => Promise<T>, priority?: Priority): AsyncComputed<T>;
|
|
6
|
+
export declare function asyncComputed<T>(getter: (signal?: AbortSignal) => Promise<T>, priority?: Priority): AsyncComputed<T>;
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export type Store<S extends object> = {
|
|
4
|
-
scope: Scope;
|
|
5
|
-
state(): S;
|
|
6
|
-
setState(fn: (s: S) => void): void;
|
|
7
|
-
subscribe(fn: Subscriber): () => void;
|
|
8
|
-
emit(type: string, payload?: any): Promise<void>;
|
|
9
|
-
on(type: string, handler: IntentHandler<S>): () => void;
|
|
10
|
-
};
|
|
1
|
+
import type { Scope } from "intentx-core-z";
|
|
2
|
+
import { Store } from "./store";
|
|
11
3
|
export declare function createStore<S extends object>(initial: S, scope?: Scope): Store<S>;
|
package/build/core/index.d.ts
CHANGED
|
@@ -5,10 +5,6 @@ export { asyncComputed } from "./asyncComputed";
|
|
|
5
5
|
export { effect } from "./effect";
|
|
6
6
|
export { watch } from "./watch";
|
|
7
7
|
export { createStore } from "./createStore";
|
|
8
|
-
export
|
|
9
|
-
export {
|
|
10
|
-
export type { Scope } from "./scope";
|
|
11
|
-
export { transaction } from "./transaction";
|
|
12
|
-
export { createSelector } from "./selector";
|
|
8
|
+
export { selectAtom, createSelector } from "./selector";
|
|
9
|
+
export type { Store, Subscriber } from "./store";
|
|
13
10
|
export { factoryAtom } from "./factoryAtom";
|
|
14
|
-
export { createTestRuntime } from "./testRuntime";
|
package/build/core/selector.d.ts
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type EqualityFn<T> = (a: T, b: T) => boolean;
|
|
2
|
+
export declare function createSelector<S, R>(select: (state: S) => R, isEqual?: EqualityFn<R>): (state: S) => R;
|
|
3
|
+
export declare function selectAtom<T, R>(atom: () => T, selector: (value: T) => R, onChange: (value: R) => void, options?: {
|
|
4
|
+
isEqual?: (a: R, b: R) => boolean;
|
|
5
|
+
immediate?: boolean;
|
|
6
|
+
}): () => void;
|
|
7
|
+
export declare function watchSelector<S, R>(getState: () => S, subscribe: (fn: () => void) => () => void, selector: (state: S) => R, onChange: (value: R) => void, isEqual?: EqualityFn<R>): () => void;
|
package/build/core/store.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import type { IntentHandler } from "intentx-core-z";
|
|
1
|
+
import type { IntentHandler, Scope } from "intentx-core-z";
|
|
2
|
+
import { EqualityFn } from "./selector";
|
|
2
3
|
export type Subscriber = () => void;
|
|
3
4
|
export type Store<S extends object> = {
|
|
5
|
+
scope: Scope;
|
|
4
6
|
state(): S;
|
|
5
7
|
setState(fn: (s: S) => void): void;
|
|
6
8
|
subscribe(fn: Subscriber): () => void;
|
|
7
|
-
emit(
|
|
8
|
-
on(
|
|
9
|
+
emit(type: string, payload?: any): Promise<void>;
|
|
10
|
+
on(type: string, handler: IntentHandler<S>): () => void;
|
|
11
|
+
watch<R>(selector: (state: S) => R, onChange: (value: R) => void, isEqual?: EqualityFn<R>): () => void;
|
|
9
12
|
};
|
package/build/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var t=require("intentx-core-z"),e=require("react");function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var r=n(e);const o={activeEffect:null};function c(e){let n=e;const r=new Set,c=new Set,u=()=>(o.activeEffect&&c.add(o.activeEffect),n);return u.set=(e,o="normal")=>{Object.is(e,n)||(n=e,c.forEach(e=>t.schedule(e,o)),r.forEach(e=>t.schedule(e,o)))},u.subscribe=t=>(r.add(t),()=>r.delete(t)),u}function u(e){let n,r=!0;const c=new Set,u=()=>{r||(r=!0,c.forEach(e=>t.schedule(e)))};return()=>{if(o.activeEffect&&c.add(o.activeEffect),r){const t=o.activeEffect;o.activeEffect=u,n=e(),r=!1,o.activeEffect=t}return n}}function l(e,n="normal"){let r=null,c=!1;const u=()=>{if(!c){null==r||r();try{o.activeEffect=u;const t=e();"function"==typeof t&&(r=t)}finally{o.activeEffect=null}}};return t.schedule(u,n),()=>{c=!0,null==r||r(),r=null}}function s(t,e,n="normal"){return l(()=>{e(t())},n)}function a(t,e=Object.is){let n,r=!1;return o=>{const c=t(o);return r&&e(n,c)?n:(r=!0,n=c,c)}}const i=t.createScope("default");function f(t){return r.useSyncExternalStore(e=>{let n=t();return l(()=>{const r=t();Object.is(n,r)||(n=r,e())})},t,t)}Object.defineProperty(exports,"createScope",{enumerable:!0,get:function(){return t.createScope}}),exports.asyncAtom=function(e){const n=c(null);let r=null,o=null;const u=()=>(r||(o=new AbortController,r=e(o.signal).then(t=>((null==o?void 0:o.signal.aborted)||n.set(t),t)).finally(()=>{r=null})),r),l=()=>{null==o||o.abort(),o=null,r=null},s=()=>{const t=n();if(null===t)throw u();return t};return s.set=n.set,s.load=u,s.cancel=l,s.invalidate=(e="normal")=>{l(),t.schedule(()=>{try{u()}catch{}},e)},s},exports.asyncComputed=function(e,n="normal"){const r=c(void 0);let o=null,u=null,l=null;const s=()=>(o||(u=new AbortController,l=null,o=e(u.signal).then(t=>((null==u?void 0:u.signal.aborted)||r.set(t,n),t)).catch(t=>{throw(null==u?void 0:u.signal.aborted)||(l=t),t}).finally(()=>{o=null})),o),a=()=>{const t=r();if(l)throw l;if(void 0===t)throw s();return t};return a.invalidate=(e=n)=>{null==u||u.abort(),u=null,o=null,t.schedule(()=>{try{s()}catch{}},e)},a},exports.atom=c,exports.computed=u,exports.createSelector=a,exports.createStore=function(e,n=i){let r=e;const o=new Set,c=t.createIntentBus((t,e)=>{const n=new AbortController;return{payload:t,scope:e,state:r,signal:n.signal,setState(t){t(r),o.forEach(t=>t())},emit:(t,n)=>c.emit(t,n,e)}});return{scope:n,state:()=>r,setState(t){t(r),o.forEach(t=>t())},subscribe:t=>(o.add(t),()=>o.delete(t)),emit:(t,e)=>c.emit(t,e,n),on:(t,e)=>c.on(t,e,n),watch:(t,e,n)=>function(t,e,n,r,o=Object.is){const c=a(n,o);let u=!1;const l=()=>{u||r(c(t()))};l();const s=e(l);return()=>{u=!0,s()}}(()=>r,t=>(o.add(t),()=>o.delete(t)),t,e,n)}},exports.effect=l,exports.factoryAtom=function(t){const e=new Map;return n=>{let r=e.get(n);return r||(r=t(n),e.set(n,r)),r}},exports.scheduleReactJob=function(t,n="normal"){"low"===n?e.startTransition(t):t()},exports.selectAtom=function(t,e,n,r){var o;const c=null!==(o=null==r?void 0:r.isEqual)&&void 0!==o?o:Object.is;let u;return l(()=>{const o=e(t());void 0!==u&&c(u,o)||(u=o,((null==r?void 0:r.immediate)||void 0!==u)&&n(o))})},exports.useAtom=f,exports.useAtomSelector=function(t,e,n=Object.is){const o=r.useRef(null),c=()=>{const r=e(t()),c=o.current;return null!==c&&n(c,r)?c:(o.current=r,r)};return r.useSyncExternalStore(e=>l(()=>{t(),e()}),c,c)},exports.useBatch=function(){return t.batch},exports.useComputed=function(t){return f(r.useMemo(()=>u(t),[t]))},exports.useEffectReact=function(t,e="normal"){r.useEffect(()=>{const n=l(t,e);return()=>n()},[t,e])},exports.useFactoryAtom=function(t,e){return f(t(e))},exports.useStore=function(t){return e.useSyncExternalStore(t.subscribe,t.state,t.state)},exports.useStoreSelector=function(t,e,n=Object.is){const o=r.useMemo(()=>a(e,n),[e,n]),c=r.useCallback(()=>o(t.state()),[t,o]);return r.useSyncExternalStore(t.subscribe,c,c)},exports.useWatch=function(t,e){r.useEffect(()=>{const n=s(t,e);return()=>null==n?void 0:n()},[t,e])},exports.watch=s;
|
package/build/index.d.ts
CHANGED
package/build/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{schedule as t,createScope as n,createIntentBus as e,batch as r}from"intentx-core-z";export{createScope
|
|
1
|
+
import{schedule as t,createScope as n,createIntentBus as e,batch as r}from"intentx-core-z";export{createScope}from"intentx-core-z";import*as o from"react";import l,{startTransition as c}from"react";const u={activeEffect:null};function i(n){let e=n;const r=new Set,o=new Set,l=()=>(u.activeEffect&&o.add(u.activeEffect),e);return l.set=(n,l="normal")=>{Object.is(n,e)||(e=n,o.forEach(n=>t(n,l)),r.forEach(n=>t(n,l)))},l.subscribe=t=>(r.add(t),()=>r.delete(t)),l}function s(n){let e,r=!0;const o=new Set,l=()=>{r||(r=!0,o.forEach(n=>t(n)))};return()=>{if(u.activeEffect&&o.add(u.activeEffect),r){const t=u.activeEffect;u.activeEffect=l,e=n(),r=!1,u.activeEffect=t}return e}}function a(n){const e=i(null);let r=null,o=null;const l=()=>(r||(o=new AbortController,r=n(o.signal).then(t=>((null==o?void 0:o.signal.aborted)||e.set(t),t)).finally(()=>{r=null})),r),c=()=>{null==o||o.abort(),o=null,r=null},u=()=>{const t=e();if(null===t)throw l();return t};return u.set=e.set,u.load=l,u.cancel=c,u.invalidate=(n="normal")=>{c(),t(()=>{try{l()}catch{}},n)},u}function f(n,e="normal"){const r=i(void 0);let o=null,l=null,c=null;const u=()=>(o||(l=new AbortController,c=null,o=n(l.signal).then(t=>((null==l?void 0:l.signal.aborted)||r.set(t,e),t)).catch(t=>{throw(null==l?void 0:l.signal.aborted)||(c=t),t}).finally(()=>{o=null})),o),s=()=>{const t=r();if(c)throw c;if(void 0===t)throw u();return t};return s.invalidate=(n=e)=>{null==l||l.abort(),l=null,o=null,t(()=>{try{u()}catch{}},n)},s}function d(n,e="normal"){let r=null,o=!1;const l=()=>{if(!o){null==r||r();try{u.activeEffect=l;const t=n();"function"==typeof t&&(r=t)}finally{u.activeEffect=null}}};return t(l,e),()=>{o=!0,null==r||r(),r=null}}function b(t,n,e="normal"){return d(()=>{n(t())},e)}function v(t,n=Object.is){let e,r=!1;return o=>{const l=t(o);return r&&n(e,l)?e:(r=!0,e=l,l)}}function m(t,n,e,r){var o;const l=null!==(o=null==r?void 0:r.isEqual)&&void 0!==o?o:Object.is;let c;return d(()=>{const o=n(t());void 0!==c&&l(c,o)||(c=o,((null==r?void 0:r.immediate)||void 0!==c)&&e(o))})}const E=n("default");function h(t,n=E){let r=t;const o=new Set,l=e((t,n)=>{const e=new AbortController;return{payload:t,scope:n,state:r,signal:e.signal,setState(t){t(r),o.forEach(t=>t())},emit:(t,e)=>l.emit(t,e,n)}});return{scope:n,state:()=>r,setState(t){t(r),o.forEach(t=>t())},subscribe:t=>(o.add(t),()=>o.delete(t)),emit:(t,e)=>l.emit(t,e,n),on:(t,e)=>l.on(t,e,n),watch:(t,n,e)=>function(t,n,e,r,o=Object.is){const l=v(e,o);let c=!1;const u=()=>{c||r(l(t()))};u();const i=n(u);return()=>{c=!0,i()}}(()=>r,t=>(o.add(t),()=>o.delete(t)),t,n,e)}}function S(t){const n=new Map;return e=>{let r=n.get(e);return r||(r=t(e),n.set(e,r)),r}}function w(t){return o.useSyncExternalStore(n=>{let e=t();return d(()=>{const r=t();Object.is(e,r)||(e=r,n())})},t,t)}function y(t,n,e=Object.is){const r=o.useRef(null),l=()=>{const o=n(t()),l=r.current;return null!==l&&e(l,o)?l:(r.current=o,o)};return o.useSyncExternalStore(n=>d(()=>{t(),n()}),l,l)}function p(){return r}function g(t){return w(o.useMemo(()=>s(t),[t]))}function x(t,n="normal"){o.useEffect(()=>{const e=d(t,n);return()=>e()},[t,n])}function j(t,n){return w(t(n))}function O(t){return l.useSyncExternalStore(t.subscribe,t.state,t.state)}function C(t,n,e=Object.is){const r=o.useMemo(()=>v(n,e),[n,e]),l=o.useCallback(()=>r(t.state()),[t,r]);return o.useSyncExternalStore(t.subscribe,l,l)}function A(t,n){o.useEffect(()=>{const e=b(t,n);return()=>null==e?void 0:e()},[t,n])}function M(t,n="normal"){"low"===n?c(t):t()}export{a as asyncAtom,f as asyncComputed,i as atom,s as computed,v as createSelector,h as createStore,d as effect,S as factoryAtom,M as scheduleReactJob,m as selectAtom,w as useAtom,y as useAtomSelector,p as useBatch,g as useComputed,x as useEffectReact,j as useFactoryAtom,O as useStore,C as useStoreSelector,A as useWatch,b as watch};
|
package/build/react/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { useAtom } from './useAtom';
|
|
2
|
+
export { useAtomSelector } from './useAtomSelector';
|
|
3
|
+
export { useBatch } from './useBatch';
|
|
2
4
|
export { useComputed } from './useComputed';
|
|
5
|
+
export { useEffectReact } from './useEffectReact';
|
|
3
6
|
export { useFactoryAtom } from './useFactoryAtom';
|
|
4
7
|
export { useStore } from './useStore';
|
|
5
8
|
export { useStoreSelector } from './useStoreSelector';
|
|
6
9
|
export { useWatch } from './useWatch';
|
|
7
|
-
export { useEffectReact } from './useEffectReact';
|
|
8
|
-
export { useBatch } from './useBatch';
|
|
9
10
|
export { scheduleReactJob } from './schedule';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function useStoreSelector<S,
|
|
1
|
+
export declare function useStoreSelector<S, R>(store: {
|
|
2
2
|
state(): S;
|
|
3
3
|
subscribe(fn: () => void): () => void;
|
|
4
|
-
}, selector: (state: S) =>
|
|
4
|
+
}, selector: (state: S) => R, isEqual?: (a: R, b: R) => boolean): R;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrono-state-z",
|
|
3
|
-
"version": "2.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Intent-first, logic-centric reactive state runtime with atoms, computed, async state, effects, and deterministic scheduling. React-agnostic core.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Delpi.Kye",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -51,25 +51,25 @@
|
|
|
51
51
|
},
|
|
52
52
|
|
|
53
53
|
"keywords": [
|
|
54
|
-
"react",
|
|
55
54
|
"state-management",
|
|
56
55
|
"reactive",
|
|
57
56
|
"atom",
|
|
58
57
|
"computed",
|
|
59
58
|
"async-state",
|
|
60
|
-
"external-store",
|
|
61
59
|
"intent",
|
|
62
60
|
"intent-first",
|
|
63
61
|
"logic-first",
|
|
64
|
-
"headless",
|
|
65
|
-
"fsm",
|
|
66
62
|
"effects",
|
|
67
|
-
"scheduler"
|
|
63
|
+
"scheduler",
|
|
64
|
+
"headless",
|
|
65
|
+
"react",
|
|
66
|
+
"react-hooks",
|
|
67
|
+
"react-18"
|
|
68
68
|
],
|
|
69
69
|
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": "^18.0.0",
|
|
72
|
-
"intentx-core-z": "^1.0
|
|
72
|
+
"intentx-core-z": "^2.1.0"
|
|
73
73
|
},
|
|
74
74
|
|
|
75
75
|
"devDependencies": {
|
package/build/core/scope.d.ts
DELETED