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


TypeScript reflux.createActions函數代碼示例

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


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

示例1: create

/**
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

import * as Reflux from 'reflux';
import events from '../../events';
import _UnitFrame from './_UnitFrame';

const FriendlyTargetStore = {
  create() {
    const actions = Reflux.createActions(['start', 'stop']);
    const store = Reflux.createStore({
      mixins: [_UnitFrame],
      topic: events.clientEventTopics.handlesFriendlyTarget,
      listenables: actions
    });
    return {
      store: store,
      actions: actions
    };
  }
};

export default FriendlyTargetStore;
開發者ID:Fidaman,項目名稱:Camelot-Unchained,代碼行數:26,代碼來源:FriendlyTargetStore.ts

示例2:

// Type definitions for reflux 0.3.0
// Project: https://github.com/reflux/refluxjs
// Definitions by: saddieeiddas <https://github.com/saddieeiddas>

/// <reference path="reflux.d.ts" />

import * as Reflux from 'reflux';

console.log(Reflux.version['reflux-core']);
console.log(Reflux.createStore({}));
console.log(Reflux.PublisherMethods.triggerPromise().then());

console.log(Reflux.createActions({
  test1: () => {},
  test2: () => {},
}));

console.log(Reflux.EventEmitter);
console.log(Reflux.utils.EventEmitter);
console.log(Reflux.Promise);

console.log(Reflux.connect('test', 'test').getInitialState());

console.log(Reflux.ListenerMixin.componentWillUnmount());

console.log(Reflux.listenTo('test', () => {}, () => {}).componentWillUnmount());
開發者ID:CUModSquad,項目名稱:Typings,代碼行數:26,代碼來源:reflux.test.ts


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