Fix reducer plugin

This commit is contained in:
Luka Zakrajsek
2017-06-26 17:01:08 +02:00
parent 8000e19efa
commit 0cdf591f07
+4 -4
View File
@@ -1,9 +1,7 @@
import { Action, Reducer } from "redux";
import { FieldType } from "../index";
export function reducer(state: FormStateMap, action: Action): FormStateMap & FormReducer;
export interface FormReducer {
export interface FormReducer extends Reducer<FormStateMap> {
/**
* Returns a form reducer that will also pass each action through
* additional reducers specified. The parameter should be an object mapping
@@ -11,9 +9,11 @@ export interface FormReducer {
* passed to each reducer will only be the slice that pertains to that
* form.
*/
plugin(reducers: FormReducerMapObject): Reducer<any>;
plugin(reducers: FormReducerMapObject): Reducer<FormStateMap>;
}
export const reducer: FormReducer;
export interface FormReducerMapObject {
[formName: string]: Reducer<any>;
}