本文整理匯總了TypeScript中domain/store/main.store.swap方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript store.swap方法的具體用法?TypeScript store.swap怎麽用?TypeScript store.swap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類domain/store/main.store
的用法示例。
在下文中一共展示了store.swap方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: updateLoading
export function updateLoading(loading: boolean) {
return store.swap(oldState => ({ ...oldState, loading }));
}
示例2: updateShadowColor
export function updateShadowColor(shadowColor: string) {
return store.swap(oldState => ({ ...oldState, shadowColor }));
}
示例3: updateDetailItem
export function updateDetailItem(detail: DetailItem) {
logger.debug(`Update detail item ${detail.name}`);
return store.swap(oldState => ({ ...oldState, detail }));
}
示例4: updateFilteredItems
export function updateFilteredItems(filteredItems: Array<Item>) {
logger.debug(`Update filtered items ${filteredItems.length}`);
return store.swap(oldState => ({ ...oldState, filteredItems }));
}
示例5: updateAllItems
export function updateAllItems(items: Array<Item>) {
logger.debug(`Update all items ${items.length} items`);
return store.swap(oldState => ({ ...oldState, allItems: items }));
}
示例6: updateCurrentPage
export function updateCurrentPage(currentPage: Page) {
logger.debug(`Update current page ${currentPage.name}`);
return store.swap(oldState => ({ ...oldState, currentPage }));
}