extra-react-hooks 0.1.8 → 0.1.11

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 CHANGED
@@ -1,7 +1,5 @@
1
1
  # extra-react-hooks
2
-
3
2
  ## Install
4
-
5
3
  ```sh
6
4
  npm install --save extra-react-hooks
7
5
  # or
@@ -9,15 +7,12 @@ yarn add extra-react-hooks
9
7
  ```
10
8
 
11
9
  ## API
12
-
13
10
  ### useToggle
14
-
15
11
  ```ts
16
12
  function useToggle(initialState: boolean = false): [on: boolean, toggle: () => void]
17
13
  ```
18
14
 
19
15
  ### useSingleSelection
20
-
21
16
  ```ts
22
17
  interface IOption<T> {
23
18
  value: T
@@ -37,13 +32,11 @@ function useSingleSelection<T>(values: T[]): {
37
32
  ```
38
33
 
39
34
  ### useMount
40
-
41
35
  ```ts
42
36
  function useMount(effect: EffectCallback): void
43
37
  ```
44
38
 
45
39
  ### useStateCycle
46
-
47
40
  ```ts
48
41
  function useStateCycle<T>(
49
42
  stateList: [T, ...T[]]
@@ -52,13 +45,11 @@ function useStateCycle<T>(
52
45
  ```
53
46
 
54
47
  ### useIsMounted
55
-
56
48
  ```ts
57
49
  function useIsMounted(): () => boolean
58
50
  ```
59
51
 
60
52
  ### useIncrement
61
-
62
53
  ```ts
63
54
  function useIncrement(
64
55
  initialValue: number
@@ -66,7 +57,6 @@ function useIncrement(
66
57
  ```
67
58
 
68
59
  ### useResizeObserver
69
-
70
60
  ```ts
71
61
  function useResizeObserver(
72
62
  callback: ResizeObserverCallback
@@ -75,7 +65,6 @@ function useResizeObserver(
75
65
  ```
76
66
 
77
67
  ### useStep
78
-
79
68
  ```ts
80
69
  function useStep<T>(
81
70
  steps: [T, ...T[]]
@@ -84,7 +73,18 @@ function useStep<T>(
84
73
  ```
85
74
 
86
75
  ### useForceUpdate
87
-
88
76
  ```ts
89
77
  function useForceUpdate(): () => void
90
78
  ```
79
+
80
+ ### useFiniteStateMachine
81
+ ```ts
82
+ function useFiniteStateMachine<State extends string, Event extends string>(
83
+ schema: IFiniteStateMachineSchema<State, Event>
84
+ , initialState: State
85
+ ): ObservableFiniteStateMachine<State, Event>
86
+ ```
87
+
88
+ The `ObservableFiniteStateMachine` comes from [@blackglory/structures].
89
+
90
+ [@blackglory/structures]: https://www.npmjs.com/package/@blackglory/structures