Socket
Socket
Sign inDemoInstall

reflux-dispatcher

Package Overview
Dependencies
4
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    reflux-dispatcher

a hot reload friendly dispatcher for reflux


Version published
Weekly downloads
25
increased by1150%
Maintainers
1
Install size
734 kB
Created
Weekly downloads
 

Readme

Source

reflux-dispatcher

a hot reload friendly dispatcher for reflux

##Usage

var dispatcher = require('reflux-dispatcher')();
var action = dispatcher.actions;
var store = dispatcher.stores;

//actions don't need to be deslared before use
action('signin').listen(function(user) {
  console.log('hello ', user.username);
});
action('signin')({username: 'undozen', password: '123'});

//store definition
store('session', {
  init: function () {
    this.listenTo(action('signin'), this.signin);
  },
  signin: function (user) {
    //do ajax signin etc...
  }
});

//laterly, you can redefined store('session')
//so here is what I mean by "hot reload friendly"
store('session', {/* new definition */});

##License MIT

Keywords

FAQs

Last updated on 12 Oct 2014

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc