forked from cerebral/overmind
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
36 lines (29 loc) · 1000 Bytes
/
index.ts
File metadata and controls
36 lines (29 loc) · 1000 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
31
32
33
34
35
36
import App, {
TConfig,
TDerive,
TOperation,
TConnect,
TAction,
} from 'react-overmind'
import * as effects from './effects'
import * as actions from './actions'
import state from './state'
const config = {
effects,
actions,
state,
}
type Config = TConfig<typeof config>
export type Action<Input = void, Output = any> = TAction<Input, Output, Config>
export type Derive = TDerive<Config>
export type Mutation<Input = any> = TOperation.Mutation<Input, Config>
export type Do<Input = any> = TOperation.Do<Input, Config>
export type Filter<Input = any> = TOperation.Filter<Input, Config>
export type When<Input = any> = TOperation.When<Input, Config>
export type Fork<Input = any> = TOperation.Fork<Input, Config>
export type Map<Input, Output> = TOperation.Map<Input, Output, Config>
export type Try<Input, Output> = TOperation.Try<Input, Output, Config>
const app = new App(config)
export type Connect = TConnect<typeof app>
export const connect = app.connect
export default app