We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c435d6a commit 9213df8Copy full SHA for 9213df8
packages/vue-primitives/src/hooks/useStateMachine.ts
@@ -1,5 +1,4 @@
1
-import type { ref } from 'vue'
2
-import { shallowRef } from 'vue'
+import { type Ref, shallowRef } from 'vue'
3
4
interface Machine<S> { [k: string]: { [k: string]: S } }
5
type MachineState<T> = keyof T
@@ -14,7 +13,7 @@ export function useStateMachine<M extends object>(
14
13
initialState: MachineState<M>,
15
machine: M & Machine<MachineState<M>>,
16
) {
17
- const state = (shallowRef as typeof ref)(initialState)
+ const state = (shallowRef as any)(initialState) as Ref<MachineState<M>>
18
19
function reducer(event: MachineEvent<M>) {
20
const nextState = (machine[state.value] as any)[event]
0 commit comments