Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fluxible

Package Overview
Dependencies
Maintainers
5
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluxible

A pluggable container for isomorphic flux applications

  • 0.4.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
470
decreased by-12.64%
Maintainers
5
Weekly downloads
 
Created
Source

Fluxible

npm version Build Status Coverage Status Dependency Status devDependency Status

Pluggable, singleton-free container for isomorphic Flux applications.

$ npm install --save fluxible

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 0.13

Extras

Usage

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: 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], {
    FooStore(store) {
        return store.getState();
    }
}));

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

// Bootstrap
const context = app.createContext();
context.executeAction(action, 'bar', function () {
    console.log(React.renderToString(context.createElement()));
});

License

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

Keywords

FAQs

Package last updated on 04 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc