本文整理汇总了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());