【发布时间】:2017-06-07 03:55:44
【问题描述】:
我目前正在做的是:
export type Action =
{ type: 'FOO' }
| { type: 'BAR' }
export type Thunk = (dispatch: Dispatch, getState: GetState) => Action | Thunk
export type Dispatch = ReduxDispatch<Action> & (action: Thunk) => void
但如果您直接在 store 上发送,则如果不重新创建 store 将无法正常工作:
export type Store = ReduxStore<State, Action>
总的来说,我的 thunk 解决方案似乎还有其他小问题。有人有redux-thunk 的工作库定义吗?我在任何地方都找不到。
【问题讨论】:
标签: reactjs redux react-redux redux-thunk