本文整理汇总了TypeScript中domain/store/main.store类的典型用法代码示例。如果您正苦于以下问题:TypeScript store类的具体用法?TypeScript store怎么用?TypeScript store使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了store类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: state
export function state(): State {
return store.deref();
}
示例2: updateLoading
export function updateLoading(loading: boolean) {
return store.swap(oldState => ({ ...oldState, loading }));
}
示例3:
/*
* Rakuten React kit
*
* Copyright Š 2017 Rakuten, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { store } from 'domain/store/main';
import render from 'renderer';
import startRouters from 'domain/middleware/router';
import { onMouseMove } from 'domain/middleware/user';
store.addWatch('renderLoop', render);
addEventListener('mousemove', onMouseMove);
startRouters();
示例4: updateShadowColor
export function updateShadowColor(shadowColor: string) {
return store.swap(oldState => ({ ...oldState, shadowColor }));
}
示例5: updateDetailItem
export function updateDetailItem(detail: DetailItem) {
logger.debug(`Update detail item ${detail.name}`);
return store.swap(oldState => ({ ...oldState, detail }));
}
示例6: updateFilteredItems
export function updateFilteredItems(filteredItems: Array<Item>) {
logger.debug(`Update filtered items ${filteredItems.length}`);
return store.swap(oldState => ({ ...oldState, filteredItems }));
}
示例7: updateAllItems
export function updateAllItems(items: Array<Item>) {
logger.debug(`Update all items ${items.length} items`);
return store.swap(oldState => ({ ...oldState, allItems: items }));
}
示例8: updateCurrentPage
export function updateCurrentPage(currentPage: Page) {
logger.debug(`Update current page ${currentPage.name}`);
return store.swap(oldState => ({ ...oldState, currentPage }));
}