Skip to content

Commit

Permalink
Remove unnecessary default values for some generic types
Browse files Browse the repository at this point in the history
  • Loading branch information
Wang Zhongliang committed Feb 27, 2018
1 parent b9d9000 commit 4eb7404
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { Middleware, Action, AnyAction } from "redux";


export type ThunkAction<R, S = {}, E = {}, A extends Action<any> = AnyAction> = (
export type ThunkAction<R, S, E, A extends Action> = (
dispatch: ThunkDispatch<S, E, A>,
getState: () => S,
extraArgument: E
) => R;

interface ThunkDispatch<S = {}, E = {}, A extends Action = AnyAction> {
interface ThunkDispatch<S, E, A extends Action> {
<T extends A>(action: T): T;
}

interface ThunkDispatch<S = {}, E = {}, A extends Action = AnyAction> {
interface ThunkDispatch<S, E, A extends Action> {
<R>(asyncAction: ThunkAction<R, S, E, A>): R;
}

type ThunkMiddleware<E, S = {}> = Middleware<ThunkDispatch<S, E>, S, ThunkDispatch<S, E>>;
type ThunkMiddleware<E, S = {}, A extends Action = AnyAction> = Middleware<ThunkDispatch<S, E, A>, S, ThunkDispatch<S, E, A>>;

declare const thunk: ThunkMiddleware<undefined> & {
withExtraArgument<E>(extraArgument: E): ThunkMiddleware<E>
Expand Down

0 comments on commit 4eb7404

Please sign in to comment.