@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 +6 -5
- package/package.json +1 -1
- package/src/usePendingState.ts +6 -5
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
|
|
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
|
|
48
|
-
* - `withState(action, options?)` reads and tracks the
|
|
49
|
-
*
|
|
50
|
-
* - `setState(update)` can
|
|
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
package/src/usePendingState.ts
CHANGED
|
@@ -41,17 +41,18 @@ export type WithStateOptions = {
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* Returns an instance of
|
|
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
|
|
52
|
-
* - `withState(action, options?)` reads and tracks the
|
|
53
|
-
*
|
|
54
|
-
* - `setState(update)` can
|
|
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,
|