本文整理汇总了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;未经允许,请勿转载。 |
请发表评论