kiss-for-react 2.0.5 → 2.0.7

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 (38) hide show
  1. package/README.md +18 -0
  2. package/lib/cjs/Evt.js +1 -2
  3. package/lib/cjs/Hooks.js +30 -0
  4. package/lib/cjs/KissAction.js +10 -0
  5. package/lib/cjs/Store.js +74 -21
  6. package/lib/cjs/index.js +4 -2
  7. package/lib/cjs/stateClass.js +36 -0
  8. package/lib/cjs/types/Evt.d.ts +1 -2
  9. package/lib/cjs/types/Evt.d.ts.map +1 -1
  10. package/lib/cjs/types/Hooks.d.ts +39 -6
  11. package/lib/cjs/types/Hooks.d.ts.map +1 -1
  12. package/lib/cjs/types/KissAction.d.ts +20 -4
  13. package/lib/cjs/types/KissAction.d.ts.map +1 -1
  14. package/lib/cjs/types/Store.d.ts +30 -5
  15. package/lib/cjs/types/Store.d.ts.map +1 -1
  16. package/lib/cjs/types/index.d.ts +1 -0
  17. package/lib/cjs/types/index.d.ts.map +1 -1
  18. package/lib/cjs/types/stateClass.d.ts +32 -0
  19. package/lib/cjs/types/stateClass.d.ts.map +1 -0
  20. package/lib/esm/Evt.mjs +1 -2
  21. package/lib/esm/Hooks.mjs +30 -0
  22. package/lib/esm/KissAction.mjs +10 -0
  23. package/lib/esm/Store.mjs +74 -21
  24. package/lib/esm/index.mjs +1 -0
  25. package/lib/esm/stateClass.mjs +33 -0
  26. package/lib/esm/types/Evt.d.ts +1 -2
  27. package/lib/esm/types/Evt.d.ts.map +1 -1
  28. package/lib/esm/types/Hooks.d.ts +39 -6
  29. package/lib/esm/types/Hooks.d.ts.map +1 -1
  30. package/lib/esm/types/KissAction.d.ts +20 -4
  31. package/lib/esm/types/KissAction.d.ts.map +1 -1
  32. package/lib/esm/types/Store.d.ts +30 -5
  33. package/lib/esm/types/Store.d.ts.map +1 -1
  34. package/lib/esm/types/index.d.ts +1 -0
  35. package/lib/esm/types/index.d.ts.map +1 -1
  36. package/lib/esm/types/stateClass.d.ts +32 -0
  37. package/lib/esm/types/stateClass.d.ts.map +1 -0
  38. package/package.json +2 -2
package/README.md CHANGED
@@ -304,6 +304,19 @@ function UserRow({ userId }: { userId: string }) {
304
304
  }
305
305
  ```
306
306
 
307
+ To show one spinner or one error while any of several actions runs or fails, pass an array.
308
+ `useExceptionFor([LoadUser, LoadPosts])` returns the `UserException` of the first type in
309
+ the array that has one:
310
+
311
+ ```tsx
312
+ const isLoading = useIsWaiting([LoadUser, LoadPosts]);
313
+ const isFailed = useIsFailed([LoadUser, LoadPosts]);
314
+ const error = useExceptionFor([LoadUser, LoadPosts]);
315
+ ```
316
+
317
+ Don't write `useIsWaiting(LoadUser) || useIsWaiting(LoadPosts)`. When the first hook returns
318
+ true, the second one is not called, and that breaks the rules of hooks.
319
+
307
320
  ### Suspense and error boundaries
308
321
 
309
322
  If you prefer React's `<Suspense>` and error boundaries to `isWaiting`/`isFailed` checks,
@@ -330,6 +343,9 @@ function UserCard({ userId }: { userId: string }) {
330
343
  }
331
344
  ```
332
345
 
346
+ When the component needs the result of several actions, pass an array:
347
+ `useSuspense([LoadUser, LoadPosts])` suspends while an action of any of the types runs.
348
+
333
349
  &nbsp;
334
350
 
335
351
  ## Actions can send events to the UI
@@ -635,6 +651,8 @@ useStoreEffect({
635
651
  });
636
652
  ```
637
653
 
654
+ To abort the actions of several types, pass an array: `store.abort([LoadUser, LoadPosts])`.
655
+
638
656
  ### Throttle
639
657
 
640
658
  To prevent an action from running too frequently, you can add a `throttle` property to
package/lib/cjs/Evt.js CHANGED
@@ -47,8 +47,7 @@ exports.EvtState = exports.Evt = void 0;
47
47
  * the same as the previous one. Reading `value` doesn't spend the event.
48
48
  *
49
49
  * The event object itself is immutable: the store keeps which events were spent (see
50
- * `store.isEventSpent`). So the state stays immutable, and two stores that share the same
51
- * state (in two tests, for example) each spend the event on their own.
50
+ * `store.isEventSpent`). So consuming an event does not change any object in the state.
52
51
  *
53
52
  * Each event is handled by one component only: the first one whose effect runs. For two
54
53
  * components to react, create two events in the state. Or use `EvtState`, when it's fine to
package/lib/cjs/Hooks.js CHANGED
@@ -704,10 +704,23 @@ function useDispatchSync() {
704
704
  *
705
705
  * Pass `{ statusKey }` to consider only the actions with that `statusKey` (see
706
706
  * `KissAction.statusKey`): `useIsWaiting(LoadUser, { statusKey: userId })`.
707
+ *
708
+ * Pass an array of types to know if an action of ANY of them is being processed:
709
+ *
710
+ * ```ts
711
+ * const isLoading = useIsWaiting([LoadUser, LoadPosts]);
712
+ * ```
713
+ *
714
+ * Use this instead of `useIsWaiting(LoadUser) || useIsWaiting(LoadPosts)`, which breaks the rules
715
+ * of hooks: when the first hook returns true, the second one is not called. An empty array
716
+ * returns false. A `statusKey` applies to all the types in the array.
707
717
  */
708
718
  function useIsWaiting(type, options) {
709
719
  const store = useStoreFromContext();
710
720
  const statusKey = options?.statusKey;
721
+ // An array written inline is a new array in each render, so this callback is also new in each
722
+ // render. That's fine: `useSyncExternalStore` only subscribes again when `subscribe` changes,
723
+ // and it re-renders only when the returned value changes.
711
724
  const getIsWaiting = (0, react_1.useCallback)(() => store.isWaiting(type, { statusKey }), [store, type, statusKey]);
712
725
  return (0, react_1.useSyncExternalStore)(store._subscribeStatus, getIsWaiting, _returnFalse);
713
726
  }
@@ -808,6 +821,9 @@ function useConfiguration() {
808
821
  *
809
822
  * Pass `{ statusKey }` to consider only the failures with that `statusKey` (see
810
823
  * `KissAction.statusKey`): `useIsFailed(LoadUser, { statusKey: userId })`.
824
+ *
825
+ * Pass an array of types to know if ANY of them failed: `useIsFailed([LoadUser, LoadPosts])`.
826
+ * An empty array returns false. A `statusKey` applies to all the types in the array.
811
827
  */
812
828
  function useIsFailed(type, options) {
813
829
  const store = useStoreFromContext();
@@ -829,6 +845,10 @@ function useIsFailed(type, options) {
829
845
  * `KissAction.statusKey`): `useExceptionFor(LoadUser, { statusKey: userId })`. Without it,
830
846
  * if actions with different keys failed, you get the `UserException` of the most recent
831
847
  * failure.
848
+ *
849
+ * Pass an array of types to get the `UserException` of the first type in the array that has
850
+ * one: `useExceptionFor([LoadUser, LoadPosts])`. Put the most important type first. An empty
851
+ * array returns `null`. A `statusKey` applies to all the types in the array.
832
852
  */
833
853
  function useExceptionFor(type, options) {
834
854
  const store = useStoreFromContext();
@@ -854,6 +874,8 @@ function useExceptionFor(type, options) {
854
874
  * Pass `{ statusKey }` to clear only the failure with that `statusKey` (see
855
875
  * `KissAction.statusKey`): `clearExceptionFor(LoadUser, { statusKey: userId })`. Without it,
856
876
  * all the failures of the type are cleared, whatever their keys.
877
+ *
878
+ * Pass an array of types to clear all of them: `clearExceptionFor([LoadUser, LoadPosts])`.
857
879
  */
858
880
  function useClearExceptionFor() {
859
881
  const store = useStoreFromContext();
@@ -903,6 +925,12 @@ function useClearExceptionFor() {
903
925
  * `KissAction.statusKey`): `useSuspense(LoadUser, { statusKey: userId })`. Without it, the
904
926
  * component suspends while any action of the type runs, and throws its most recent failure.
905
927
  *
928
+ * Pass an array of types when the component needs the result of several actions:
929
+ * `useSuspense([LoadUser, LoadPosts])`. The component suspends while an action of ANY of the
930
+ * types runs, and renders again when none of them runs. Then, if any of them failed, it throws
931
+ * the error of the first type in the array that failed. A `statusKey` applies to all the types
932
+ * in the array.
933
+ *
906
934
  * On the server and while hydrating, the hook never suspends or throws, like `useIsWaiting`
907
935
  * and `useIsFailed` are `false` there (see `StoreProviderProps.serverState`). After hydration,
908
936
  * it follows the live store.
@@ -1058,6 +1086,8 @@ class StoreDispatchers {
1058
1086
  * ```
1059
1087
  *
1060
1088
  * Pass `{ statusKey }` to abort only the actions with that `statusKey`.
1089
+ *
1090
+ * Pass an array of types to abort the actions of all of them: `abort([LoadUser, LoadPosts])`.
1061
1091
  */
1062
1092
  abort(type, options) {
1063
1093
  this.store.abort(type, options);
@@ -1087,6 +1087,9 @@ class KissAction {
1087
1087
  *
1088
1088
  * Pass `{ statusKey }` to consider only the actions with that `statusKey` (see `statusKey`):
1089
1089
  * `this.isWaiting(LoadUser, { statusKey: userId })`.
1090
+ *
1091
+ * Pass an array of types to know if an action of ANY of them is being processed:
1092
+ * `this.isWaiting([LoadUser, LoadPosts])`.
1090
1093
  */
1091
1094
  isWaiting(type, options) {
1092
1095
  return this.store.isWaiting(type, options);
@@ -1100,6 +1103,8 @@ class KissAction {
1100
1103
  *
1101
1104
  * Pass `{ statusKey }` to consider only the failures with that `statusKey` (see `statusKey`):
1102
1105
  * `this.isFailed(LoadUser, { statusKey: userId })`.
1106
+ *
1107
+ * Pass an array of types to know if ANY of them failed: `this.isFailed([LoadUser, LoadPosts])`.
1103
1108
  */
1104
1109
  isFailed(type, options) {
1105
1110
  return this.store.isFailed(type, options);
@@ -1113,6 +1118,9 @@ class KissAction {
1113
1118
  * Pass `{ statusKey }` to get the exception of the failure with that `statusKey` (see
1114
1119
  * `statusKey`): `this.exceptionFor(LoadUser, { statusKey: userId })`. Without it, if actions
1115
1120
  * with different keys failed, you get the `UserException` of the most recent failure.
1121
+ *
1122
+ * Pass an array of types to get the `UserException` of the first type in the array that has
1123
+ * one: `this.exceptionFor([LoadUser, LoadPosts])`.
1116
1124
  */
1117
1125
  exceptionFor(type, options) {
1118
1126
  return this.store.exceptionFor(type, options);
@@ -1133,6 +1141,8 @@ class KissAction {
1133
1141
  * Pass `{ statusKey }` to clear only the failure with that `statusKey` (see `statusKey`):
1134
1142
  * `this.clearExceptionFor(LoadUser, { statusKey: userId })`. Without it, all the failures of
1135
1143
  * the type are cleared, whatever their keys.
1144
+ *
1145
+ * Pass an array of types to clear all of them: `this.clearExceptionFor([LoadUser, LoadPosts])`.
1136
1146
  */
1137
1147
  clearExceptionFor(type, options) {
1138
1148
  return this.store.clearExceptionFor(type, options);
package/lib/cjs/Store.js CHANGED
@@ -2646,13 +2646,20 @@ class Store {
2646
2646
  * Pass `{ statusKey }` to abort only the actions with that `statusKey` (see
2647
2647
  * `KissAction.statusKey`): `store.abort(LoadUser, { statusKey: userId })`.
2648
2648
  *
2649
+ * Pass an array of types to abort the actions of all of them. For example, when a screen
2650
+ * closes: `onUnmount: (store) => store.abort([LoadUser, LoadPosts])`. A `statusKey` applies to
2651
+ * all the types in the array.
2652
+ *
2649
2653
  * To abort a single action instance, use its `abort()` method.
2650
2654
  */
2651
2655
  abort(type, options) {
2656
+ const types = _toTypeArray(type);
2652
2657
  const statusKey = options?.statusKey;
2658
+ const name = Array.isArray(type) ? `[${types.map(t => t.name).join(', ')}]` : types[0].name;
2653
2659
  for (const action of this._actionsInProgress) {
2654
- if (action instanceof type && (statusKey === undefined || (0, KissAction_1._isSameNonReentrantKey)(action.statusKey, statusKey)))
2655
- action._abort(`The action was aborted by store.abort(${type.name}).`);
2660
+ if (types.some(t => action instanceof t) &&
2661
+ (statusKey === undefined || (0, KissAction_1._isSameNonReentrantKey)(action.statusKey, statusKey)))
2662
+ action._abort(`The action was aborted by store.abort(${name}).`);
2656
2663
  }
2657
2664
  }
2658
2665
  /**
@@ -2673,11 +2680,17 @@ class Store {
2673
2680
  *
2674
2681
  * Pass `{ statusKey }` to consider only the actions with that `statusKey` (see
2675
2682
  * `KissAction.statusKey`): `store.isWaiting(LoadUser, { statusKey: userId })`.
2683
+ *
2684
+ * Pass an array of types to know if an action of ANY of them is being processed:
2685
+ * `store.isWaiting([LoadUser, LoadPosts])`. An empty array returns false. A `statusKey`
2686
+ * applies to all the types in the array.
2676
2687
  */
2677
2688
  isWaiting(type, options) {
2689
+ const types = _toTypeArray(type);
2678
2690
  const statusKey = options?.statusKey;
2679
2691
  for (const action of this._actionsInProgress) {
2680
- if (action instanceof type && (statusKey === undefined || (0, KissAction_1._isSameNonReentrantKey)(action.statusKey, statusKey))) {
2692
+ if (types.some(t => action instanceof t) &&
2693
+ (statusKey === undefined || (0, KissAction_1._isSameNonReentrantKey)(action.statusKey, statusKey))) {
2681
2694
  return true;
2682
2695
  }
2683
2696
  }
@@ -2692,9 +2705,13 @@ class Store {
2692
2705
  *
2693
2706
  * Pass `{ statusKey }` to consider only the failures with that `statusKey` (see
2694
2707
  * `KissAction.statusKey`): `store.isFailed(LoadUser, { statusKey: userId })`.
2708
+ *
2709
+ * Pass an array of types to know if ANY of them failed:
2710
+ * `store.isFailed([LoadUser, LoadPosts])`. An empty array returns false. A `statusKey`
2711
+ * applies to all the types in the array.
2695
2712
  */
2696
2713
  isFailed(type, options) {
2697
- return this._findFailure(type, options) !== null;
2714
+ return _toTypeArray(type).some(t => this._findFailure(t, options) !== null);
2698
2715
  }
2699
2716
  /**
2700
2717
  * Returns the `UserException` of the `type` that failed. Returns `null` if it didn't fail,
@@ -2706,8 +2723,20 @@ class Store {
2706
2723
  * `KissAction.statusKey`): `store.exceptionFor(LoadUser, { statusKey: userId })`. Without it,
2707
2724
  * if actions with different keys failed, you get the `UserException` of the most recent
2708
2725
  * failure.
2726
+ *
2727
+ * Pass an array of types to get the `UserException` of the first type in the array that has
2728
+ * one: `store.exceptionFor([LoadUser, LoadPosts])`. Put the most important type first. An
2729
+ * empty array returns `null`. A `statusKey` applies to all the types in the array.
2709
2730
  */
2710
2731
  exceptionFor(type, options) {
2732
+ if (Array.isArray(type)) {
2733
+ for (const t of type) {
2734
+ const exception = this.exceptionFor(t, options);
2735
+ if (exception !== null)
2736
+ return exception;
2737
+ }
2738
+ return null;
2739
+ }
2711
2740
  const failures = this._failedActions.get(type);
2712
2741
  if (failures === undefined)
2713
2742
  return null;
@@ -2741,12 +2770,19 @@ class Store {
2741
2770
  * Pass `{ statusKey }` to clear only the failure with that `statusKey` (see
2742
2771
  * `KissAction.statusKey`): `store.clearExceptionFor(LoadUser, { statusKey: userId })`.
2743
2772
  * Without it, all the failures of the type are cleared, whatever their keys.
2773
+ *
2774
+ * Pass an array of types to clear all of them: `store.clearExceptionFor([LoadUser, LoadPosts])`.
2775
+ * The components are updated only once. A `statusKey` applies to all the types in the array.
2744
2776
  */
2745
2777
  clearExceptionFor(type, options) {
2746
2778
  const statusKey = options?.statusKey;
2747
- const removed = (statusKey === undefined)
2748
- ? this._failedActions.delete(type)
2749
- : this._removeFailure(type, statusKey);
2779
+ let removed = false;
2780
+ for (const t of _toTypeArray(type)) {
2781
+ const removedThis = (statusKey === undefined)
2782
+ ? this._failedActions.delete(t)
2783
+ : this._removeFailure(t, statusKey);
2784
+ removed = removedThis || removed;
2785
+ }
2750
2786
  if (removed)
2751
2787
  this._statusListeners.notify();
2752
2788
  }
@@ -2766,35 +2802,44 @@ class Store {
2766
2802
  this._statusListeners.notify();
2767
2803
  }
2768
2804
  /**
2769
- * Internal: the value `useSuspense` reads as its snapshot, for the given action `type` and
2770
- * `statusKey` (`undefined` matches any key):
2771
- *
2772
- * - A promise, while an action of the type (or of a subclass) with that key is in progress,
2773
- * as `isWaiting` sees it. The same promise object is returned until the action finishes, as
2774
- * React's Suspense needs, and it resolves then (see `_resolveSuspenseWaits`). The promise
2775
- * is created the first time it's asked for, so a store whose components never call
2805
+ * Internal: the value `useSuspense` reads as its snapshot, for the given action `type` (or
2806
+ * array of types) and `statusKey` (`undefined` matches any key):
2807
+ *
2808
+ * - A promise, while an action of the type (or of a subclass), or of any of the types in the
2809
+ * array, with that key is in progress, as `isWaiting` sees it. The same promise object is
2810
+ * returned until no such action is in progress, as React's Suspense needs, and it resolves
2811
+ * then (see `_resolveSuspenseWaits`). Arrays are compared by their content, so an array
2812
+ * written inline in the component gets the same promise on every render. The promise is
2813
+ * created the first time it's asked for, so a store whose components never call
2776
2814
  * `useSuspense` creates none.
2777
2815
  * - Otherwise, when `throwErrors` is true, the failure record of the type with that key, as
2778
- * `isFailed` sees it (the exact type; without a key, the most recent failure). It's the
2779
- * same object until the failure is replaced or cleared.
2816
+ * `isFailed` sees it (the exact type; without a key, the most recent failure). With an
2817
+ * array, the failure of the first type in the array that failed. It's the same object until
2818
+ * the failure is replaced or cleared.
2780
2819
  * - Otherwise `null`.
2781
2820
  *
2782
2821
  * @internal
2783
2822
  */
2784
2823
  _suspenseValue(type, statusKey, throwErrors = true) {
2785
- if (this.isWaiting(type, { statusKey })) {
2786
- let wait = this._suspenseWaits.find(w => w.type === type && (0, KissAction_1._isSameNonReentrantKey)(w.statusKey, statusKey));
2824
+ const types = _toTypeArray(type);
2825
+ if (this.isWaiting(types, { statusKey })) {
2826
+ let wait = this._suspenseWaits.find(w => _isSameTypeArray(w.types, types) && (0, KissAction_1._isSameNonReentrantKey)(w.statusKey, statusKey));
2787
2827
  if (wait === undefined) {
2788
2828
  let resolve;
2789
2829
  const promise = new Promise(r => resolve = r);
2790
- wait = { type, statusKey, promise, resolve };
2830
+ wait = { types: [...types], statusKey, promise, resolve };
2791
2831
  this._suspenseWaits.push(wait);
2792
2832
  }
2793
2833
  return wait.promise;
2794
2834
  }
2795
2835
  if (!throwErrors)
2796
2836
  return null;
2797
- return this._findFailure(type, { statusKey });
2837
+ for (const t of types) {
2838
+ const failure = this._findFailure(t, { statusKey });
2839
+ if (failure !== null)
2840
+ return failure;
2841
+ }
2842
+ return null;
2798
2843
  }
2799
2844
  /**
2800
2845
  * Resolves and removes the `useSuspense` promises whose action is not in progress anymore.
@@ -2805,7 +2850,7 @@ class Store {
2805
2850
  return;
2806
2851
  for (let i = this._suspenseWaits.length - 1; i >= 0; i--) {
2807
2852
  const wait = this._suspenseWaits[i];
2808
- if (!this.isWaiting(wait.type, { statusKey: wait.statusKey })) {
2853
+ if (!this.isWaiting(wait.types, { statusKey: wait.statusKey })) {
2809
2854
  this._suspenseWaits.splice(i, 1);
2810
2855
  wait.resolve();
2811
2856
  }
@@ -4313,6 +4358,14 @@ class PrintableSet extends Set {
4313
4358
  * days), by chaining timers. A delay of `Infinity` never fires. Returns a function that cancels
4314
4359
  * the timeout.
4315
4360
  */
4361
+ /** Returns the given action type as an array with one type, or the given array of types. */
4362
+ function _toTypeArray(type) {
4363
+ return Array.isArray(type) ? type : [type];
4364
+ }
4365
+ /** True if both arrays have the same action types, in the same order. */
4366
+ function _isSameTypeArray(a, b) {
4367
+ return a.length === b.length && a.every((type, i) => type === b[i]);
4368
+ }
4316
4369
  function _setLongTimeout(callback, millis) {
4317
4370
  if (millis === Infinity)
4318
4371
  return () => { };
package/lib/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OptimisticSyncWithPush = exports.OptimisticSync = exports.OptimisticCommand = exports.UserException = exports.TimeoutException = exports.AbortDispatchException = exports.StoreException = exports.useDispatcher = exports.useDispatchWhen = exports.useDispatchSync = exports.useDispatchAndWaitAll = exports.useDispatchAndWait = exports.useDispatchAll = exports.useDispatch = exports.useLayoutEvent = exports.useEvent = exports.EvtState = exports.Evt = exports.useConfiguration = exports.useEnvironment = exports.useIsOnline = exports.useIsFocused = exports.useSuspense = exports.useClearExceptionFor = exports.useExceptionFor = exports.useIsFailed = exports.useIsWaiting = exports.useIsStoreReady = exports.StoreSlice = exports.StoreProvider = exports.useObject = exports.useSelector = exports.useSelect = exports.useAllState = exports.useStoreEffect = exports.useStore = exports.createStore = exports.Store = exports.ActionStatus = exports.UserExceptionAction = exports.MergeServerStateAction = exports.KissAction = exports.ProcessPersistence = exports.ClassPersistor = exports.UpdateStateAction = exports.PersistAction = exports.PersistException = exports.PersistorDummy = exports.PersistorPrinterDecorator = exports.Persistor = void 0;
4
- exports.Pages = exports.LoadPages = exports.Poll = exports.ServerPush = void 0;
3
+ exports.OptimisticSync = exports.OptimisticCommand = exports.UserException = exports.TimeoutException = exports.AbortDispatchException = exports.StoreException = exports.useDispatcher = exports.useDispatchWhen = exports.useDispatchSync = exports.useDispatchAndWaitAll = exports.useDispatchAndWait = exports.useDispatchAll = exports.useDispatch = exports.useLayoutEvent = exports.useEvent = exports.EvtState = exports.Evt = exports.useConfiguration = exports.useEnvironment = exports.useIsOnline = exports.useIsFocused = exports.useSuspense = exports.useClearExceptionFor = exports.useExceptionFor = exports.useIsFailed = exports.useIsWaiting = exports.useIsStoreReady = exports.StoreSlice = exports.StoreProvider = exports.useObject = exports.useSelector = exports.useSelect = exports.useAllState = exports.useStoreEffect = exports.useStore = exports.createStore = exports.Store = exports.ActionStatus = exports.UserExceptionAction = exports.MergeServerStateAction = exports.KissAction = exports.ProcessPersistence = exports.ClassPersistor = exports.UpdateStateAction = exports.PersistAction = exports.PersistException = exports.PersistorDummy = exports.PersistorPrinterDecorator = exports.Persistor = exports.stateClass = void 0;
4
+ exports.Pages = exports.LoadPages = exports.Poll = exports.ServerPush = exports.OptimisticSyncWithPush = void 0;
5
5
  const Persistor_1 = require("./Persistor");
6
6
  Object.defineProperty(exports, "PersistAction", { enumerable: true, get: function () { return Persistor_1.PersistAction; } });
7
7
  Object.defineProperty(exports, "PersistException", { enumerable: true, get: function () { return Persistor_1.PersistException; } });
@@ -10,6 +10,8 @@ Object.defineProperty(exports, "PersistorDummy", { enumerable: true, get: functi
10
10
  Object.defineProperty(exports, "PersistorPrinterDecorator", { enumerable: true, get: function () { return Persistor_1.PersistorPrinterDecorator; } });
11
11
  const ClassPersistor_1 = require("./ClassPersistor");
12
12
  Object.defineProperty(exports, "ClassPersistor", { enumerable: true, get: function () { return ClassPersistor_1.ClassPersistor; } });
13
+ var stateClass_1 = require("./stateClass");
14
+ Object.defineProperty(exports, "stateClass", { enumerable: true, get: function () { return stateClass_1.stateClass; } });
13
15
  const ProcessPersistence_1 = require("./ProcessPersistence");
14
16
  Object.defineProperty(exports, "ProcessPersistence", { enumerable: true, get: function () { return ProcessPersistence_1.ProcessPersistence; } });
15
17
  const KissAction_1 = require("./KissAction");
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stateClass = stateClass;
4
+ /**
5
+ * Optional class decorator that declares that a class belongs to application state.
6
+ *
7
+ * Marking each state class makes its purpose visible to readers, AI agents, and tools
8
+ * without having to find the store that uses it. The Kiss ESLint plugin recognizes
9
+ * annotated classes and checks them even when no store uses them yet. Automatic state
10
+ * class detection remains available without this decorator.
11
+ *
12
+ * The optional `kiss-for-react/missing-state-class` ESLint rule (off by default) requires
13
+ * this decorator on detected state classes, including nested classes. Enable TypeScript
14
+ * type information in ESLint to detect state classes across files.
15
+ *
16
+ * This decorator does not change the class, freeze objects, or add runtime metadata.
17
+ * It supports modern TypeScript class decorators and legacy `experimentalDecorators`.
18
+ * Your application's compiler must support decorator syntax. Applications that do not
19
+ * use this decorator need no decorator configuration.
20
+ * With TypeScript 5 or later, omit `experimentalDecorators` (or use `false`) for modern
21
+ * decorators. For the legacy format, set `compilerOptions.experimentalDecorators: true`
22
+ * in `tsconfig.json`. Babel or SWC must also be configured to accept the chosen decorator
23
+ * format if they compile the application. ESLint's `projectService` is a separate setting.
24
+ * The linter README's "Configuring decorators" section gives a configuration example.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * @stateClass
29
+ * class User {
30
+ * constructor(public readonly name: string) {}
31
+ * }
32
+ * ```
33
+ */
34
+ function stateClass(_target, _context) {
35
+ // A declaration for readers and lint tools; preserve the original class.
36
+ }
@@ -44,8 +44,7 @@
44
44
  * the same as the previous one. Reading `value` doesn't spend the event.
45
45
  *
46
46
  * The event object itself is immutable: the store keeps which events were spent (see
47
- * `store.isEventSpent`). So the state stays immutable, and two stores that share the same
48
- * state (in two tests, for example) each spend the event on their own.
47
+ * `store.isEventSpent`). So consuming an event does not change any object in the state.
49
48
  *
50
49
  * Each event is handled by one component only: the first one whose effect runs. For two
51
50
  * components to react, create two events in the state. Or use `EvtState`, when it's fine to
@@ -1 +1 @@
1
- {"version":3,"file":"Evt.d.ts","sourceRoot":"","sources":["../../../src/Evt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,qBAAa,GAAG,CAAC,CAAC,GAAG,IAAI;IAEvB;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC;IAS9B;;;OAGG;gBACS,KAAK,CAAC,EAAE,CAAC;IAKrB;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,C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action: KissAction<any>) => void;
468
468
  *
469
469
  * Pass `{ statusKey }` to consider only the actions with that `statusKey` (see
470
470
  * `KissAction.statusKey`): `useIsWaiting(LoadUser, { statusKey: userId })`.
471
+ *
472
+ * Pass an array of types to know if an action of ANY of them is being processed:
473
+ *
474
+ * ```ts
475
+ * const isLoading = useIsWaiting([LoadUser, LoadPosts]);
476
+ * ```
477
+ *
478
+ * Use this instead of `useIsWaiting(LoadUser) || useIsWaiting(LoadPosts)`, which breaks the rules
479
+ * of hooks: when the first hook returns true, the second one is not called. An empty array
480
+ * returns false. A `statusKey` applies to all the types in the array.
471
481
  */
472
- export declare function useIsWaiting(type: abstract new (...args: any[]) => KissAction<any>, options?: StatusOptions): boolean;
482
+ export declare function useIsWaiting(type: (abstract new (...args: any[]) => KissAction<any>) | readonly (abstract new (...args: any[]) => KissAction<any>)[], options?: StatusOptions): boolean;
473
483
  /**
474
484
  * Returns true if the store is ready, and false while it's still loading the persisted state.
475
485
  * See `Store.ready()`.
@@ -549,10 +559,15 @@ export declare function useConfiguration<C = unknown>(): C;
549
559
  *
550
560
  * Pass `{ statusKey }` to consider only the failures with that `statusKey` (see
551
561
  * `KissAction.statusKey`): `useIsFailed(LoadUser, { statusKey: userId })`.
562
+ *
563
+ * Pass an array of types to know if ANY of them failed: `useIsFailed([LoadUser, LoadPosts])`.
564
+ * An empty array returns false. A `statusKey` applies to all the types in the array.
552
565
  */
553
566
  export declare function useIsFailed(type: {
554
567
  new (...args: any[]): KissAction<any>;
555
- }, options?: StatusOptions): boolean;
568
+ } | readonly {
569
+ new (...args: any[]): KissAction<any>;
570
+ }[], options?: StatusOptions): boolean;
556
571
  /**
557
572
  * Returns the `UserException` of the `type` that failed. Returns `null` if it didn't fail,
558
573
  * or if it failed with an error that is not a `UserException` (in that case, `isFailed` is
@@ -567,10 +582,16 @@ export declare function useIsFailed(type: {
567
582
  * `KissAction.statusKey`): `useExceptionFor(LoadUser, { statusKey: userId })`. Without it,
568
583
  * if actions with different keys failed, you get the `UserException` of the most recent
569
584
  * failure.
585
+ *
586
+ * Pass an array of types to get the `UserException` of the first type in the array that has
587
+ * one: `useExceptionFor([LoadUser, LoadPosts])`. Put the most important type first. An empty
588
+ * array returns `null`. A `statusKey` applies to all the types in the array.
570
589
  */
571
590
  export declare function useExceptionFor(type: {
572
591
  new (...args: any[]): KissAction<any>;
573
- }, options?: StatusOptions): UserException | null;
592
+ } | readonly {
593
+ new (...args: any[]): KissAction<any>;
594
+ }[], options?: StatusOptions): UserException | null;
574
595
  /**
575
596
  * Removes the exact given action `type` from the list of action types that failed.
576
597
  * Note it clears the EXACT given type. Subtypes are not considered.
@@ -589,10 +610,14 @@ export declare function useExceptionFor(type: {
589
610
  * Pass `{ statusKey }` to clear only the failure with that `statusKey` (see
590
611
  * `KissAction.statusKey`): `clearExceptionFor(LoadUser, { statusKey: userId })`. Without it,
591
612
  * all the failures of the type are cleared, whatever their keys.
613
+ *
614
+ * Pass an array of types to clear all of them: `clearExceptionFor([LoadUser, LoadPosts])`.
592
615
  */
593
616
  export declare function useClearExceptionFor(): (type: {
594
617
  new (...args: any[]): KissAction<any>;
595
- }, options?: StatusOptions) => void;
618
+ } | readonly {
619
+ new (...args: any[]): KissAction<any>;
620
+ }[], options?: StatusOptions) => void;
596
621
  /**
597
622
  * Options for `useSuspense`.
598
623
  *
@@ -647,6 +672,12 @@ export type SuspenseOptions = StatusOptions & {
647
672
  * `KissAction.statusKey`): `useSuspense(LoadUser, { statusKey: userId })`. Without it, the
648
673
  * component suspends while any action of the type runs, and throws its most recent failure.
649
674
  *
675
+ * Pass an array of types when the component needs the result of several actions:
676
+ * `useSuspense([LoadUser, LoadPosts])`. The component suspends while an action of ANY of the
677
+ * types runs, and renders again when none of them runs. Then, if any of them failed, it throws
678
+ * the error of the first type in the array that failed. A `statusKey` applies to all the types
679
+ * in the array.
680
+ *
650
681
  * On the server and while hydrating, the hook never suspends or throws, like `useIsWaiting`
651
682
  * and `useIsFailed` are `false` there (see `StoreProviderProps.serverState`). After hydration,
652
683
  * it follows the live store.
@@ -655,7 +686,7 @@ export type SuspenseOptions = StatusOptions & {
655
686
  * the start, so its local state (`useState`, `useRef`) is lost. A component that already
656
687
  * rendered keeps its state while suspended. This is how React's Suspense works.
657
688
  */
658
- export declare function useSuspense(type: abstract new (...args: any[]) => KissAction<any>, options?: SuspenseOptions): void;
689
+ export declare function useSuspense(type: (abstract new (...args: any[]) => KissAction<any>) | readonly (abstract new (...args: any[]) => KissAction<any>)[], options?: SuspenseOptions): void;
659
690
  /**
660
691
  * Handles an event (`Evt` or `EvtState`) from the state, by calling the `callback` with its
661
692
  * value, once per event:
@@ -730,8 +761,10 @@ declare class StoreDispatchers<St> {
730
761
  * ```
731
762
  *
732
763
  * Pass `{ statusKey }` to abort only the actions with that `statusKey`.
764
+ *
765
+ * Pass an array of types to abort the actions of all of them: `abort([LoadUser, LoadPosts])`.
733
766
  */
734
- abort<T extends KissAction<St>>(type: abstract new (...args: any[]) => T, options?: StatusOptions): void;
767
+ abort<T extends KissAction<St>>(type: (abstract new (...args: any[]) => T) | readonly (abstract new (...args: any[]) => KissAction<St>)[], options?: StatusOptions): void;
735
768
  /**
736
769
  * Dispatches the action to the Redux store, to potentially change the state.
737
770
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Hooks.d.ts","sourceRoot":"","sources":["../../../src/Hooks.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AA8BtC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,GAAG,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EAAE,EACvD,EACE,mBAA2B,EAC3B,aAAoB,EACpB,SAAS,GACV,GAAE;QACD,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;KAClB,GAAG,OAAO,CAAC,IAAI,CAAC;IASxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,yBAAyB,CACvB,WAAW,EAAE;QAAE,KAAI,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC,CAAA;KAAE,EAAE,EACtD,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,SAAS,CAAC,EAAE,SAAS,CAAA;KAAE,GACjE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC1B,yBAAyB,CACvB,WAAW,EAAE;QAAE,KAAI,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC,CAAA;KAAE,EAAE,EACtD,OAAO,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,GACjE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;CAiBlC"}
@@ -701,8 +701,11 @@ export declare abstract class KissAction<St> {
701
701
  *
702
702
  * Pass `{ statusKey }` to consider only the actions with that `statusKey` (see `statusKey`):
703
703
  * `this.isWaiting(LoadUser, { statusKey: userId })`.
704
+ *
705
+ * Pass an array of types to know if an action of ANY of them is being processed:
706
+ * `this.isWaiting([LoadUser, LoadPosts])`.
704
707
  */
705
- isWaiting<T extends KissAction<St>>(type: abstract new (...args: any[]) => T, options?: StatusOptions): boolean;
708
+ isWaiting<T extends KissAction<St>>(type: (abstract new (...args: any[]) => T) | readonly (abstract new (...args: any[]) => KissAction<St>)[], options?: StatusOptions): boolean;
706
709
  /**
707
710
  * Returns true if the given action `type` failed, with any error, not only with a
708
711
  * `UserException`. Use `exceptionFor` to get the error, if it was a `UserException`.
@@ -712,10 +715,14 @@ export declare abstract class KissAction<St> {
712
715
  *
713
716
  * Pass `{ statusKey }` to consider only the failures with that `statusKey` (see `statusKey`):
714
717
  * `this.isFailed(LoadUser, { statusKey: userId })`.
718
+ *
719
+ * Pass an array of types to know if ANY of them failed: `this.isFailed([LoadUser, LoadPosts])`.
715
720
  */
716
721
  isFailed<T extends KissAction<any>>(type: {
717
722
  new (...args: any[]): T;
718
- }, options?: StatusOptions): boolean;
723
+ } | readonly {
724
+ new (...args: any[]): KissAction<any>;
725
+ }[], options?: StatusOptions): boolean;
719
726
  /**
720
727
  * Returns the `UserException` of the `type` that failed. Returns `null` if it didn't fail,
721
728
  * or if it failed with an error that is not a `UserException` (in that case, `isFailed` is
@@ -725,10 +732,15 @@ export declare abstract class KissAction<St> {
725
732
  * Pass `{ statusKey }` to get the exception of the failure with that `statusKey` (see
726
733
  * `statusKey`): `this.exceptionFor(LoadUser, { statusKey: userId })`. Without it, if actions
727
734
  * with different keys failed, you get the `UserException` of the most recent failure.
735
+ *
736
+ * Pass an array of types to get the `UserException` of the first type in the array that has
737
+ * one: `this.exceptionFor([LoadUser, LoadPosts])`.
728
738
  */
729
739
  exceptionFor<T extends KissAction<St>>(type: {
730
740
  new (...args: any[]): T;
731
- }, options?: StatusOptions): (UserException | null);
741
+ } | readonly {
742
+ new (...args: any[]): KissAction<St>;
743
+ }[], options?: StatusOptions): (UserException | null);
732
744
  /**
733
745
  * Removes the exact given action `type` from the list of action types that failed.
734
746
  * Note it clears the EXACT given type. Subtypes are not considered.
@@ -745,10 +757,14 @@ export declare abstract class KissAction<St> {
745
757
  * Pass `{ statusKey }` to clear only the failure with that `statusKey` (see `statusKey`):
746
758
  * `this.clearExceptionFor(LoadUser, { statusKey: userId })`. Without it, all the failures of
747
759
  * the type are cleared, whatever their keys.
760
+ *
761
+ * Pass an array of types to clear all of them: `this.clearExceptionFor([LoadUser, LoadPosts])`.
748
762
  */
749
763
  clearExceptionFor<T extends KissAction<St>>(type: {
750
764
  new (...args: any[]): T;
751
- }, options?: StatusOptions): void;
765
+ } | readonly {
766
+ new (...args: any[]): KissAction<St>;
767
+ }[], options?: StatusOptions): void;
752
768
  /**
753
769
  * Clears the failures of all action types, so that `isFailed` is `false` and `exceptionFor`
754
770
  * is `null` for all of them. Same as `store.clearAllExceptions()`.