有什么方法可以从使用 redux-mock-store 创建的商店中正确调度 Thunk 吗?现在我被迫使用任何类型断言
store.dispatch<any>(getCommissions());
正如dispatch
预期的那样提供简单的动作
[ts]
Argument of type '(dispatch: ThunkDispatch<IRootState, undefined,
AnyAction>, getState: () => IRootState) => void' is not assignable to parameter of type 'AnyAction'.
Property 'type' is missing in type '(dispatch: ThunkDispatch<IRootState, undefined, AnyAction>, getState: () => IRootState) => void'.
代码片段getCommisions()
export function getCommissions() {
return (dispatch: ThunkDispatch<IRootState, undefined, AnyAction>, getState: () => IRootState) => { ... }