re-reduced
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -11,3 +11,3 @@ export interface Action<T = void> { | ||
export interface ActionReducerMap<TState> { | ||
[key: string]: ActionReducer<any, TState>; | ||
[key: string]: ActionReducer<TState, any>; | ||
} | ||
@@ -18,6 +18,6 @@ export interface ActionCreator<TPayload = void> { | ||
type: string; | ||
reduce: <TState>(handler: ActionReducer<TPayload, TState>) => { | ||
[key: string]: ActionReducer<TPayload, TState>; | ||
reduce: <TState>(reducer: ActionReducer<TState, TPayload>) => { | ||
[key: string]: ActionReducer<TState, TPayload>; | ||
}; | ||
} | ||
export declare type ActionReducer<TPayload, TState> = (s: TState, p: TPayload) => TState; | ||
export declare type ActionReducer<TState, TPayload> = (s: TState, p: TPayload) => TState; |
@@ -14,3 +14,3 @@ "use strict"; | ||
if (typeof actionReducer === "function") { | ||
return actionReducer(action.payload, state); | ||
return actionReducer(state, action.payload); | ||
} | ||
@@ -17,0 +17,0 @@ return state; |
{ | ||
"name": "re-reduced", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "A utility toolbelt that reduces boilerplate from your react/redux app", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -44,3 +44,3 @@ [![npm module](https://badge.fury.io/js/re-reduced.svg)](https://www.npmjs.org/package/re-reduced) | ||
### ActionReducer<TPayload, TState> | ||
### ActionReducer<TState, TPayload> | ||
@@ -55,3 +55,3 @@ ```js | ||
interface ActionReducerMap<TState> { | ||
[key: string]: ActionReducer<any, TState>; | ||
[key: string]: ActionReducer<TState, any>; | ||
} | ||
@@ -58,0 +58,0 @@ ``` |