- 授权协议: BSD
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: https://github.com/yahoo/fluxible
软件介绍
Fluxible 是用于 Flux 应用的可插拔容器。
特征:
服务器可免费使用单体模式进行渲染
无状态异步操作
便于集成的高阶组件
增强磁通流动
可在 Flux 内容上增加你的接口
更新至 React 0.13
示例代码:
import Fluxible from 'fluxible';
import React from 'react';
import {connectToStores, createStore, provideContext} from 'fluxible/addons';
// Action
const action = (actionContext, payload) => {
actionContext.dispatch('FOO_ACTION', payload);
};
// Store
const FooStore = createStore({
storeName: 'FooStore',
handlers: {
'FOO_ACTION': 'fooHandler'
},
initialize: () => { // Set the initial state
this.foo = null;
},
fooHandler: (payload) => {
this.foo = payload;
},
getState: () => {
return {
foo: this.foo
}
}
});
