-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.ts
More file actions
30 lines (22 loc) · 699 Bytes
/
index.ts
File metadata and controls
30 lines (22 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import * as actions from './actions';
import { IConfig, IContext, IOnInitialize } from 'overmind';
import { createHooks } from 'overmind-vue/vue3';
import { state } from './state';
export const config = {
state,
actions,
effects: {},
};
// Due to circular typing we have to define an
// explicit typing of state, actions and effects since
// TS 3.9
export type Config = IConfig<{
state: typeof config.state;
actions: typeof config.actions;
effects: typeof config.effects;
}>;
export type OnInitialize = IOnInitialize<Config>;
export type Context = IContext<Config>;
// Used with derived
export type RootState = Context['state'];
export const useOvermind = createHooks<Config>();