How to use the reflux.createStore function in reflux

To help you get started, we’ve selected a few reflux examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 7kfpun / FinanceReactNative / App / Utils / Property / store.js View on Github external
/* @flow */
var Reflux = require('reflux');
var Actions = require('./actions');

var Store = Reflux.createStore({
  listenables: Actions,

  onChangeShowingProperty: function(item) {
    console.log('onChangeShowingProperty');
    this.trigger(item);
  },
});

module.exports = Store;
github jekyll-store / engine / src / stores / PaymentOptionsStore.js View on Github external
// Includes
var Reflux = require('reflux');
var I = require('seamless-immutable');
var resource = require('../mixins/resource');

var PaymentOptionsStore = Reflux.createStore({
	// Public
  mixins: [resource('paymentOptions')],
  onSetPaymentOptions: function(args) {
    t.paymentOptions = I(args);
    t.trigger({ paymentOptions: t.paymentOptions });
  }
});

var t = module.exports = PaymentOptionsStore;
github shalomeir / snippod-boilerplate / snippod_webapp / client / scripts / stores / authentication / AccountStore.js View on Github external
'use strict';

var Reflux = require('reflux'),
    Im = require('immutable'),
    accountDefault = require('../../constants/defaults').account,
    AuthAccountActions = require('../../actions/authentication/AuthAccountActions');

var AccountStore = Reflux.createStore({

  listenables: AuthAccountActions,

  init: function() {
    this.account = Im.Map(accountDefault);
  },

  getAccount: function() {
    return this.account.toJS();
  },

  /* Listen AuthAccountActions
   ===============================*/
  _mergeAccountData: function(resData) {
    this.account = this.account.merge(Im.Map(resData));
    this.trigger();
github jekyll-store / engine / test / mixins / listenAndMix.spec.js View on Github external
it('does nothing initially', function() {
      myStore = Reflux.createStore({
        mixins: [listenAndMix(myAction, 'callback')],
        callback: callback
      });
      assert(callback.notCalled);
    });
github stayradiated / terminal.sexy / lib / stores / app.js View on Github external
'#85678f',
      '#5e8d87',
      '#707880',
      '#373b41',
      '#cc6666',
      '#b5bd68',
      '#f0c674',
      '#81a2be',
      '#b294bb',
      '#8abeb7',
      '#c5c8c6'
    ]
  }).colors;
}

var AppStore = Reflux.createStore({

  init: function () {
    this.listenTo(actions.setAllColors, this._setAllColors);
    this.listenTo(actions.setColor, this._setColor);
    this.listenTo(actions.setFont, this._setFont);
  },

  getState: function () {
    return state;
  },

  _setAllColors: function (name, colors) {
    state.scheme = name;
    state.colors = colors;
    updateUrl();
    this.trigger(state);

reflux

A simple library for uni-directional dataflow application architecture inspired by ReactJS Flux

BSD-3-Clause
Latest version published 8 years ago

Package Health Score

59 / 100
Full package analysis