Home

Awesome

reflux-core

A simple core library for unidirectional dataflow architecture inspired by Flux. This module does not depend on React and may be used together with other view engine libraries.

NPM Version NPM Downloads Dependencies Build Status Gratipay

Sauce Test Status

For an overview of reflux with react extensions, look at the refluxjs repository.

Here are the API docs for reflux-core.

Installation

You can currently install the package as an npm package.

NPM

The following command installs reflux-core as an npm package:

npm install reflux-core

ES5

Reflux depends on ES5 features. For older browsers that are missing them you will need a shim such as core-js/es5 from core-js or es5-shim.js from kriskowal's es5-shim.

Development

You need to have NodeJS installed.

  1. Clone this repository

  2. Run npm install

You can run the following npm scripts, for more check the project's package.json file.

Husky git hooks will prevent bad commits or bad pushes for you by linting and testing the code.

Extending reflux-core

As an add-on

To create an add-on for Reflux, you may do that by creating a callback that Reflux#use can handle.

// addon.js

// The callback recieves an instance of Reflux library that is being used.
export default function(Reflux) {

    // add a simple function to Reflux
    Reflux.createState = function() {
        return {};
    };

}

The user will have to do the following to use the add-on:

import Reflux from "reflux-core";
    // or "reflux" or any other reflux with extensions

import createStateAddon from "./addon.js";

Reflux.use(createStateAddon);

console.log(Reflux.createState());
// outputs {}

As extensions for a view library

Install reflux-core as a dependency and publish it as a library to npm. Here is an example entry point:

// index.js
import Reflux from "reflux-core";
import frameworkExtras from "./framework-extras";

Reflux.use(frameworkExtras); // like an add-on

export default Reflux; // export the amended Reflux lib

Colophon

List of contributors is available on Github.

This project is licensed under BSD 3-Clause License. Copyright (c) 2014, Mikael Brassman.

For more information about the license for this particular project read the LICENSE.md file.

This project uses eventemitter3, is currently MIT licensed and has it's license information here.