本文整理汇总了TypeScript中redux.Dispatch类的典型用法代码示例。如果您正苦于以下问题:TypeScript Dispatch类的具体用法?TypeScript Dispatch怎么用?TypeScript Dispatch使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Dispatch类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: async
return async (dispatch: Dispatch<FetchGetRealmType>) => {
dispatch(RequestGetRealms());
dispatch(ReceiveGetRealms(await getStatus(region.name)));
};
示例2: dispatch
promise: Promise.resolve((action: string, dispatch: Dispatch<any>, getState: Function) => {
dispatch({ type: "SECEOND_ACTION_TYPE", payload: "..." });
dispatch(someActionCreator());
})
示例3: return
return (dispatch: Dispatch<Action>) => {
dispatch({
type: "LOGOUT",
});
};
示例4: dispatch
onMaximizePanel: () => dispatch(maximizePanel(panelId)),
示例5: dispatch
visitHome: () => {
dispatch({ type: ROUTE_ACTION_TYPES.HOME });
},
示例6: setTimeout
setTimeout(() => {
dispatch(Actions.deleteTodo(id))
setTimeout(() => dispatch(Actions.setTodoDeleted(id)), 250)
}, 150)
示例7: dispatch
onToggle: (id: number) => {
dispatch(Actions.toggleTodo(id))
},
示例8: dispatch
).then(() =>
Promise.all([
dispatch(makeASandwichWithSecretSauce('Me')),
dispatch(makeASandwichWithSecretSauce('My wife'))
])