@@ -14,18 +14,29 @@ There are three approaches to connecting Overmind to Vue.
1414{% tab title="overmind/index.js" %}
1515``` typescript
1616
17- import { createHooks } from ' overmind-vue/vu3'
17+ import {
18+ createStateHook ,
19+ createActionsHook ,
20+ createEffectsHook ,
21+ createReactionHook
22+ } from ' overmind-vue/vu3'
1823
1924export const config = {
2025 state: {
2126 foo: ' bar'
2227 },
2328 actions: {
2429 onClick() {}
25- }
30+ },
31+ effects: {}
2632}
2733
28- export const hooks = createHooks ()
34+ export const hooks = {
35+ state: createStateHook (),
36+ actions: createActionsHook (),
37+ effects: createEffectsHook (),
38+ reaction: createReactionHook ()
39+ }
2940```
3041{% endtab %}
3142
@@ -149,7 +160,13 @@ With **TypeScript** you type them by:
149160``` typescript
150161// overmind/index.ts
151162import { IContext } from ' overmind'
152- import {createHooks } from ' overmind-vue/vu3'
163+
164+ import {
165+ createStateHook ,
166+ createActionsHook ,
167+ createEffectsHook ,
168+ createReactionHook
169+ } from ' overmind-vue/vu3'
153170import { state } from ' ./state'
154171import * as actions from ' ./actions'
155172
@@ -163,7 +180,12 @@ export type Context = IContext<{
163180 actions: typeof config .actions
164181}>
165182
166- export const hooks = createHooks <Context >()
183+ export const hooks = {
184+ state: createStateHook <Context >(),
185+ actions: createActionsHook <Context >(),
186+ effects: createEffectsHook <Context >(),
187+ reaction: createReactionHook <Context >()
188+ }
167189```
168190{% endtab %}
169191{% endtabs %}
0 commit comments