當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript main.store類代碼示例

本文整理匯總了TypeScript中domain/store/main.store的典型用法代碼示例。如果您正苦於以下問題:TypeScript store類的具體用法?TypeScript store怎麽用?TypeScript store使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了store類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: state

export function state(): State {
  return store.deref();
}
開發者ID:rakuten-frontend,項目名稱:rakuten-react-kit,代碼行數:3,代碼來源:main.ts

示例2: updateLoading

export function updateLoading(loading: boolean) {
  return store.swap(oldState => ({ ...oldState, loading }));
}
開發者ID:rakuten-frontend,項目名稱:rakuten-react-kit,代碼行數:3,代碼來源:main.ts

示例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();
開發者ID:rakuten-frontend,項目名稱:rakuten-react-kit,代碼行數:17,代碼來源:main.ts

示例4: updateShadowColor

export function updateShadowColor(shadowColor: string) {
  return store.swap(oldState => ({ ...oldState, shadowColor }));
}
開發者ID:rakuten-frontend,項目名稱:rakuten-react-kit,代碼行數:3,代碼來源:main.ts

示例5: updateDetailItem

export function updateDetailItem(detail: DetailItem) {
  logger.debug(`Update detail item ${detail.name}`);
  return store.swap(oldState => ({ ...oldState, detail }));
}
開發者ID:rakuten-frontend,項目名稱:rakuten-react-kit,代碼行數:4,代碼來源:main.ts

示例6: updateFilteredItems

export function updateFilteredItems(filteredItems: Array<Item>) {
  logger.debug(`Update filtered items ${filteredItems.length}`);
  return store.swap(oldState => ({ ...oldState, filteredItems }));
}
開發者ID:rakuten-frontend,項目名稱:rakuten-react-kit,代碼行數:4,代碼來源:main.ts

示例7: updateAllItems

export function updateAllItems(items: Array<Item>) {
  logger.debug(`Update all items ${items.length} items`);
  return store.swap(oldState => ({ ...oldState, allItems: items }));
}
開發者ID:rakuten-frontend,項目名稱:rakuten-react-kit,代碼行數:4,代碼來源:main.ts

示例8: updateCurrentPage

export function updateCurrentPage(currentPage: Page) {
  logger.debug(`Update current page ${currentPage.name}`);
  return store.swap(oldState => ({ ...oldState, currentPage }));
}
開發者ID:rakuten-frontend,項目名稱:rakuten-react-kit,代碼行數:4,代碼來源:main.ts


注:本文中的domain/store/main.store類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。