Question: Work with two or more states on Reflux

Question

Work with two or more states on Reflux

Answers 0
Added at 2016-04-15 03:04
Tags
Question

I want to try work with differents states in the stores of Reflux, I have this code:

/* Module dependencies */

import Reflux from 'reflux';
import AppActions from '../actions/app';

export default Reflux.createStore({
  listenables: [AppActions],

  init: function () {
    this.getConfig();
  },

  getInitialState: function () {
    return {
      name: 'default',
      info: ''
    };
  },

  getConfig: function () {
    this.info = 'new info';
    this.trigger(this.info);
  }
});

When I call state name in the render component after the trigger, it returns undefined...

The idea works with the plugin reflux-state-mixin but it uses a deprecated method: isMounted()... so I omited.

Answers to

Work with two or more states on Reflux

Source Show
◀ Wstecz