fluxible
A pluggable container for isomorphic flux applications
Last updated 4 years ago by lingyan .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install fluxible 
SYNC missed versions from official npm registry.

Fluxible

NPM version

Pluggable, singleton-free container for isomorphic Flux applications.

$ npm install --save fluxible

Join the #fluxible channel of the Reactiflux Discord community.

Gitter chat

Docs

Features

  • Singleton-free for server rendering
  • Store dehydration for client bootstrapping
  • Stateless async actions
  • Higher order components for easy integration
  • Enforcement of Flux flow - restricted access to the Flux interface from within components
  • Pluggable - add your own interfaces to the Flux context
  • Updated for React 15

Extras

Usage

import Fluxible from 'fluxible';
import {createStore} from 'fluxible/addons';
import {
    connectToStores,
    createElementWithContext,
    provideContext
} from 'fluxible-addons-react';
import React from 'react';
import ReactDOM from 'react-dom/server';

// Action
const action = (actionContext, payload) => {
    actionContext.dispatch('FOO_ACTION', payload);
};

// Store
const FooStore = createStore({
    storeName: 'FooStore',
    handlers: {
        'FOO_ACTION': 'fooHandler'
    },
    initialize: function () { // Set the initial state
        this.foo = null;
    },
    fooHandler: function (payload) {
        this.foo = payload;
    },
    getState: function () {
        return {
            foo: this.foo
        }
    }
});

// Component
class App extends React.Component {
    render() {
        return <span>{this.props.foo}</span>
    }
}

App = provideContext(connectToStores(App, [FooStore], (context, props) => {
    return context.getStore(FooStore).getState();
}));

// App
const app = new Fluxible({
    component: App,
    stores: [FooStore]
});

// Bootstrap
const context = app.createContext();
context.executeAction(action, 'bar', (err) => {
    console.log(ReactDOM.renderToString(createElementWithContext(context)));
});

Browser Compatibility

Fluxible is written with ES2015 in mind and should be used along with polyfills for features like Promise and Object.assign in order to support all browsers. We recommend using Babel along with its polyfill.

License

This software is free to use under the Yahoo Inc. BSD license. See the LICENSE file for license text and copyright information.

Current Tags

  • 1.4.0                                ...           latest (4 years ago)
  • 1.3.0-alpha.1                                ...           next (4 years ago)
  • 1.0.4-rc2                                ...           test (5 years ago)

52 Versions

  • 1.4.0                                ...           4 years ago
  • 1.3.0                                ...           4 years ago
  • 1.3.0-alpha.1                                ...           4 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.5                                ...           5 years ago
  • 1.0.4                                ...           5 years ago
  • 1.0.4-rc2                                ...           5 years ago
  • 1.0.4-rc1                                ...           5 years ago
  • 0.5.7                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 0.5.6                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 0.5.5                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 1.0.0-rc1                                ...           5 years ago
  • 0.5.4                                ...           5 years ago
  • 0.5.3                                ...           5 years ago
  • 0.5.2                                ...           5 years ago
  • 0.5.1                                ...           6 years ago
  • 0.5.0                                ...           6 years ago
  • 0.5.0-alpha.1                                ...           6 years ago
  • 0.4.12                                ...           6 years ago
  • 0.4.11                                ...           6 years ago
  • 0.4.10                                ...           6 years ago
  • 0.4.9                                ...           6 years ago
  • 0.4.8                                ...           6 years ago
  • 0.4.7                                ...           6 years ago
  • 0.4.6                                ...           6 years ago
  • 0.4.5                                ...           6 years ago
  • 0.4.4 [deprecated]           ...           6 years ago
  • 0.4.3                                ...           6 years ago
  • 0.4.2                                ...           6 years ago
  • 0.4.1                                ...           6 years ago
  • 0.4.0                                ...           6 years ago
  • 0.3.3                                ...           6 years ago
  • 0.2.10                                ...           6 years ago
  • 0.3.2                                ...           6 years ago
  • 0.3.1                                ...           6 years ago
  • 0.3.0                                ...           6 years ago
  • 0.2.9                                ...           6 years ago
  • 0.2.8                                ...           6 years ago
  • 0.2.7                                ...           6 years ago
  • 0.2.6                                ...           6 years ago
  • 0.2.5                                ...           6 years ago
  • 0.2.4                                ...           6 years ago
  • 0.2.3                                ...           6 years ago
  • 0.2.2                                ...           6 years ago
  • 0.2.1                                ...           6 years ago
  • 0.2.0                                ...           6 years ago
  • 0.1.5                                ...           6 years ago
  • 0.0.0                                ...           6 years ago

Copyright 2014 - 2016 © taobao.org |