Browse Source

export ActionHandler (#1201)

- while testing we have methods using this method signature and it would be nice if we did not have define this.

We were running into the issue as reported in https://github.com/Microsoft/TypeScript/issues/7960

So workaround was to do something like
```
const loginAction = userActions.login as ModuleAction<UserState>;
```
Sabith Karippullil Soopy 7 năm trước cách đây
mục cha
commit
57f3cb2572
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      types/index.d.ts

+ 2 - 2
types/index.d.ts

@@ -86,8 +86,8 @@ export interface StoreOptions<S> {
   strict?: boolean;
 }
 
-type ActionHandler<S, R> = (injectee: ActionContext<S, R>, payload: any) => any;
-interface ActionObject<S, R> {
+export type ActionHandler<S, R> = (injectee: ActionContext<S, R>, payload: any) => any;
+export interface ActionObject<S, R> {
   root?: boolean;
   handler: ActionHandler<S, R>;
 }