本文整理匯總了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'))
])