Skip to content

Commit

Permalink
Merge pull request #11 from dphilipson/bugfix/exported-types-redux
Browse files Browse the repository at this point in the history
Additional fix to exported types
  • Loading branch information
dphilipson authored May 2, 2017
2 parents 7eb065c + 1734e5b commit 56754af
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import { Action, ActionCreator, isType } from "typescript-fsa";

// Redeclare AnyAction from typescript-fsa so modules can export reducers created by this library
// without requiring a dependency on typescript-fsa.
export interface AnyAction {
type: any;
}
import { Action, ActionCreator, AnyAction, isType } from "typescript-fsa";

export interface ReducerBuilder<InS extends OutS, OutS> {
case<P>(actionCreator: ActionCreator<P>, handler: Handler<InS, OutS, P>): ReducerBuilder<InS, OutS>;
caseWithAction<P>(
actionCreator: ActionCreator<P>,
handler: Handler<InS, OutS, Action<P>>,
): ReducerBuilder<InS, OutS>;
build(): (state: InS, action: AnyAction) => OutS;
// Intentionally avoid AnyAction type so modules can export reducers created using .build()
// without requiring a dependency on typescript-fsa.
build(): (state: InS, action: { type: any }) => OutS;
(state: InS, action: AnyAction): OutS;
}

Expand Down

0 comments on commit 56754af

Please sign in to comment.