New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fluxdux

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluxdux

Flux and Redux together

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-28.57%
Maintainers
1
Weekly downloads
 
Created
Source

FluxDux

The best of both FLUX and Redux all in one package.

Description

This library is a mixture of both FLUX and Redux's features. Each store will only be keeping its own data state, the state is reduced through store.reduce method. Store does not listen directly to actions, but through an immediate object called the handler. These handlers will listen to actions that being dispatched from view.

For more detail explaination, please follow this tutorial.

Install

Install directly from npm using command-line.

npm install --save fluxdux

Or clone from github

git clone https://github.com/nquangtrung/fluxdux

Usage

Please see demo/demo.js for some quick usage example.

Define store with its reducers.

var FluxDux = require('../fluxdux.js');
var store = FluxDux.createStore('notes', {
    initialState : function() { ... },
    add : function(state, data) { 
        /* Add new note to current state and return a new state */ 
        return newState; 
    },
    delete : function(state, data) { 
        /* Remove data from current state and return a new state */ 
        return newState; 
    },
    /* Other reducers here */
});

Define actions.

var actions = FluxDux.createActions(
	[ "add", "delete" ]
);

How handler will connect action and store

FluxDux.handle(actions, {
    add : function(data) {
        store.reduce("add", data);
    },
    delete : function(data) {
        store.reduce("delete", data);
    }
});

Actions can be dispatched through directly calling the method.

actions.add({ text: "text1", author: "author1" });
actions.delete({ index: 1 });
actions.add({ text: "text2", author: "author2" });

NPM package

alt text

Keywords

FAQs

Package last updated on 16 Jan 2016

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