Merge pull request #17372 from gavingregory/master

[redux-immutable] Fix definitions for 'redux-immutable', missing getDefaultState second param on combineReducers()
This commit is contained in:
Nathan Shively-Sanders
2017-06-22 16:13:43 -07:00
committed by GitHub
3 changed files with 28 additions and 6 deletions
+7 -3
View File
@@ -1,8 +1,12 @@
// Type definitions for redux-immutable v3.0.10
// Type definitions for redux-immutable v3.0.33
// Project: https://github.com/gajus/redux-immutable
// Definitions by: Pedro Pereira <https://github.com/oizie>, Sebastian Sebald <https://github.com/sebald/>
// Definitions by: Pedro Pereira <https://github.com/oizie>
// Sebastian Sebald <https://github.com/sebald/>
// Gavin Gregory <https://github.com/gavingregory>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as Redux from 'redux';
import { Collection } from 'immutable';
export declare function combineReducers<S>(reducers: Redux.ReducersMapObject): Redux.Reducer<S>;
export declare function combineReducers<S, T>(reducers: Redux.ReducersMapObject, getDefaultState?: () => Collection.Keyed<T, S>): Redux.Reducer<S>;
export declare function combineReducers<S>(reducers: Redux.ReducersMapObject, getDefaultState?: () => Collection.Indexed<S>): Redux.Reducer<S>;
+2 -1
View File
@@ -1,5 +1,6 @@
{
"dependencies": {
"redux": "^3.6.0"
"redux": "^3.6.0",
"immutable": "^3.8.1"
}
}
+19 -2
View File
@@ -1,5 +1,22 @@
import { combineReducers } from 'redux-immutable';
import { Map, List } from 'immutable';
combineReducers({
});
// Dummy State interface
interface State { };
/**
* Combine reducers should work with only one argument (a reducers object).
*/
combineReducers({});
combineReducers<State>({});
/**
* Combine reducers should accepts a function (getDefaultState()) as a second parameter, that returns an immutable Collection.Keyed collection.
*/
combineReducers<State, string>({}, () => { return Map<string, State>(); });
combineReducers<State, number>({}, () => { return Map<number, State>(); });
/**
* Combine reducers should accepts a function (getDefaultState()) as a second parameter, that returns an immutable Collection.Indexed collection.
*/
combineReducers<State>({}, () => { return List<State>(); });