本文整理匯總了TypeScript中common/actions/index.actions類的典型用法代碼示例。如果您正苦於以下問題:TypeScript actions類的具體用法?TypeScript actions怎麽用?TypeScript actions使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了actions類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
const pushGame = (game: Game) => {
if (!game) {
return;
}
if (isInternal) {
isInternal = false;
// we need to turn that into an https URL presto
this.ctx.store.dispatch(
actions.evolveTab({
window: "root",
tab: this.tab,
url: game.url,
resource: `games/${gameId}`,
replace: true,
})
);
}
this.push(gameToTabData(game));
};
示例2:
action: payload => actions.modalResponse(payload),
示例3:
(sniffedLang, preferenceLang) => {
const lang = preferenceLang || sniffedLang || fallbackLang;
schedule.dispatch(actions.languageChanged({ lang }));
}
示例4: each
each(Object.keys(this.reactors), key => {
if (!actions.hasOwnProperty(key)) {
throw new Error(`trying to react to unknown action type ${key}`);
}
});