@t8/react-pending 1.0.27 → 1.0.28

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.d.ts CHANGED
@@ -37,17 +37,18 @@ export type WithStateOptions = {
37
37
  throws?: boolean;
38
38
  };
39
39
  /**
40
- * Returns an instance of pending state and the functions to update it.
40
+ * Returns an instance of an action's state and the functions to update it.
41
41
  *
42
42
  * @param store - A unique store key or a store. Providing a store
43
43
  * key or a shared store allows to share the state across multiple
44
44
  * components.
45
45
  *
46
46
  * @returns `[state, withState, setState]`, where
47
- * - `state` is the current value of the pending state;
48
- * - `withState(action, options?)` reads and tracks the pending state
49
- * of `action`;
50
- * - `setState(update)` can update the pending state value directly.
47
+ * - `state` is the current value of the action's state;
48
+ * - `withState(action, options?)` reads and tracks the `actions`'s state
49
+ * which is exposed as `state` listed above;
50
+ * - `setState(update)` can replace the current `state` value directly with
51
+ * an another state value.
51
52
  */
52
53
  export declare function usePendingState(store?: string | Store<PendingState> | null): [
53
54
  PendingState,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t8/react-pending",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "Concise async action state tracking for React apps",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -41,17 +41,18 @@ export type WithStateOptions = {
41
41
  };
42
42
 
43
43
  /**
44
- * Returns an instance of pending state and the functions to update it.
44
+ * Returns an instance of an action's state and the functions to update it.
45
45
  *
46
46
  * @param store - A unique store key or a store. Providing a store
47
47
  * key or a shared store allows to share the state across multiple
48
48
  * components.
49
49
  *
50
50
  * @returns `[state, withState, setState]`, where
51
- * - `state` is the current value of the pending state;
52
- * - `withState(action, options?)` reads and tracks the pending state
53
- * of `action`;
54
- * - `setState(update)` can update the pending state value directly.
51
+ * - `state` is the current value of the action's state;
52
+ * - `withState(action, options?)` reads and tracks the `actions`'s state
53
+ * which is exposed as `state` listed above;
54
+ * - `setState(update)` can replace the current `state` value directly with
55
+ * an another state value.
55
56
  */
56
57
  export function usePendingState(
57
58
  store?: string | Store<PendingState> | null,