本文整理匯總了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;
示例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());