Skip to content

Commit 24e6021

Browse files
authored
Merge pull request #156 from cerebral/TApp
fix(overmind): add TApp type back
2 parents a116103 + 1f739ba commit 24e6021

File tree

1 file changed

+13
-0
lines changed
  • packages/node_modules/overmind/src

1 file changed

+13
-0
lines changed

packages/node_modules/overmind/src/types.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ export interface TConfig<Config extends Configuration> {
2525
effects: Config['effects'] & {}
2626
}
2727

28+
// This is the type of the `app` argument passed in components.
29+
export type TApp<Config extends Configuration> = {
30+
// Resolves `Derive` types in state.
31+
state: ResolveState<Config['state'] & {}>
32+
actions: ResolveActions<Config['actions']>
33+
reaction: (
34+
name: string,
35+
stateCb: (state: TApp<Config>['state']) => any,
36+
Function
37+
) => void
38+
}
39+
40+
// This is the type of the argument passed in actions.
2841
export type TValueContext<Config extends Configuration, Value> = TBaseContext<
2942
Config
3043
> & {

0 commit comments

Comments
 (0)