我在combineReducers (import { combineReducers } from 'redux-immutable')的typescript中这样打电话:
return combineReducers({
byId,
visibleIds
})(state, action)但打字本抱怨道:
Cannot invoke an expression whose type lacks a call signature.所以我看到了类型定义文件:
declare module "redux-immutable" {
export function combineReducers(reducers : Object): Object;
}如何正确调用combineReducer?
发布于 2016-05-21 12:10:14
类型定义是错误的,这应该有效:
declare module "redux-immutable" {
export function combineReducers(reducers : Object): Function;
}虽然类型定义是正式的,但Redux类型是:
function combineReducers<S>(reducers: ReducersMapObject): Reducer<S>;https://stackoverflow.com/questions/37362044
复制相似问题