@@ -43,7 +43,7 @@ export interface Action {
4343 *
4444 * @template S State object type.
4545 */
46- export type Reducer < S > = < A extends Action > ( state : S | undefined , action : A ) => S ;
46+ export type Reducer < S , A extends Action = Action > = ( state : S | undefined , action : A ) => S ;
4747
4848/**
4949 * Object whose values correspond to different reducer functions.
@@ -93,8 +93,8 @@ export function combineReducers<S>(reducers: ReducersMapObject<S>): Reducer<S>;
9393 * transform, delay, ignore, or otherwise interpret actions or async actions
9494 * before passing them to the next middleware.
9595 */
96- export interface Dispatch < S > {
97- < A extends Action > ( action : A ) : A ;
96+ export interface Dispatch < A extends Action = Action > {
97+ ( action : A ) : A ;
9898}
9999
100100/**
@@ -138,7 +138,7 @@ export interface Store<S> {
138138 * Note that, if you use a custom middleware, it may wrap `dispatch()` to
139139 * return something else (for example, a Promise you can await).
140140 */
141- dispatch : Dispatch < S > ;
141+ dispatch : Dispatch ;
142142
143143 /**
144144 * Reads the state tree managed by the store.
@@ -254,7 +254,7 @@ export const createStore: StoreCreator;
254254/* middleware */
255255
256256export interface MiddlewareAPI < S > {
257- dispatch : Dispatch < S > ;
257+ dispatch : Dispatch ;
258258 getState ( ) : S ;
259259}
260260
@@ -268,7 +268,7 @@ export interface MiddlewareAPI<S> {
268268 * asynchronous API call into a series of synchronous actions.
269269 */
270270export interface Middleware {
271- < S > ( api : MiddlewareAPI < S > ) : ( next : Dispatch < S > ) => Dispatch < S > ;
271+ < S > ( api : MiddlewareAPI < S > ) : ( next : Dispatch ) => Dispatch ;
272272}
273273
274274/**
@@ -340,19 +340,19 @@ export interface ActionCreatorsMapObject {
340340 * creator wrapped into the `dispatch` call. If you passed a function as
341341 * `actionCreator`, the return value will also be a single function.
342342 */
343- export function bindActionCreators < A extends ActionCreator < any > > ( actionCreator : A , dispatch : Dispatch < any > ) : A ;
343+ export function bindActionCreators < A extends ActionCreator < any > > ( actionCreator : A , dispatch : Dispatch ) : A ;
344344
345345export function bindActionCreators <
346346 A extends ActionCreator < any > ,
347347 B extends ActionCreator < any >
348- > ( actionCreator : A , dispatch : Dispatch < any > ) : B ;
348+ > ( actionCreator : A , dispatch : Dispatch ) : B ;
349349
350- export function bindActionCreators < M extends ActionCreatorsMapObject > ( actionCreators : M , dispatch : Dispatch < any > ) : M ;
350+ export function bindActionCreators < M extends ActionCreatorsMapObject > ( actionCreators : M , dispatch : Dispatch ) : M ;
351351
352352export function bindActionCreators <
353353 M extends ActionCreatorsMapObject ,
354354 N extends ActionCreatorsMapObject
355- > ( actionCreators : M , dispatch : Dispatch < any > ) : N ;
355+ > ( actionCreators : M , dispatch : Dispatch ) : N ;
356356
357357
358358/* compose */
0 commit comments