S
S
Stepan2015-10-26 19:50:42
JavaScript
Stepan, 2015-10-26 19:50:42

Not subscribing to events in react?

actions = require('../actions/menu.js');

module.exports = Reflux.createStore({
    listenables: [actions],
    init: function () {

        console.log(actions.toggleMenu)
        this.listenTo(actions.toggleMenu, this.onToggleMenu);

        console.log('init', this)
},

Why is togglMenu - undefined ;
This is the error
Cannot read property 'listen' of undefined causes.
What am I doing wrong? It looks like everything is connected. But it doesn't work, what could be the problem?
By the way, action
module.exports = Reflux.createAction([
    'callAi',
    'logout',
    'fullScreen',
    'toggleMenu',
    'showSidebar'
]);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stepan, 2015-10-27
@xoma2

I'm an idiot, I missed the letter s in createAction.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question