Flux应用可插拔容器Fluxible.zip

时间:2022-08-06 22:25:47
【文件属性】:
文件名称:Flux应用可插拔容器Fluxible.zip
文件大小:1.65MB
文件格式:ZIP
更新时间:2022-08-06 22:25:47
开源项目 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         }     } }); 标签:Fluxible

网友评论