Reflux.all does not properly keep a list of listeners #81

Closed
spoike opened this Issue Sep 24, 2014 · 0 comments

Comments

Projects
None yet
1 participant
@spoike
Member

spoike commented Sep 24, 2014

Bug since 0.1.8. Reflux.all has a tendency to loose all of the listeners it listens to and will kill the cyclic dependency check.

Testcase

    var action = Reflux.createAction();
    var action2 = Reflux.createAction();
    var action3 = Reflux.createAction();
    var store = Reflux.createStore({
        init: function() {
            this.listenTo(action, this.trigger);
        }
    });

    var join = Reflux.all(store, action2);

    var store = Reflux.createStore({
        init: function() {
            this.listenTo(join, this.trigger);
        }
    });

    Console = function() {
        this.listenTo(store, this.output);
        this.listenTo(action3, this.output); // CRASHES HERE
    }
    Console.prototype.output = function() {
        console.log(arguments);
    };
    _.extend(Console.prototype, Reflux.ListenerMixin);

    var c = new Console();

    action("Hello");
    action2("World");

@spoike spoike added the bug label Sep 24, 2014

@spoike spoike added this to the 0.1.10 milestone Sep 24, 2014

spoike added a commit that referenced this issue Sep 24, 2014

Hotfix v0.1.10
This fixes issue in #81. Bumped version to 0.1.10.

@spoike spoike closed this Sep 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment