mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
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:
Vendored
+7
-3
@@ -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>;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"redux": "^3.6.0"
|
||||
"redux": "^3.6.0",
|
||||
"immutable": "^3.8.1"
|
||||
}
|
||||
}
|
||||
@@ -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>(); });
|
||||
|
||||
Reference in New Issue
Block a user