Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular checks are broken #80

Closed
spoike opened this issue Sep 24, 2014 · 1 comment
Closed

Circular checks are broken #80

spoike opened this issue Sep 24, 2014 · 1 comment
Labels
Milestone

Comments

@spoike
Copy link
Member

spoike commented Sep 24, 2014

Listening to stores in components are broken in 0.1.8.

More info will come as I am debugging this now.

@spoike spoike added the bug label Sep 24, 2014
@spoike spoike added this to the 0.1.9 milestone Sep 24, 2014
@spoike
Copy link
Member Author

spoike commented Sep 24, 2014

Apparently listening to e.g. the same store in two different components will fail the circular check even though there is no circular loop happening.

Test example

    var tickAction = Reflux.createAction(),
        currentTick = 0;

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

    Console1 = function() {
        this.listenTo(store, this.output);
    }
    Console1.prototype.output = function(tick) {
        console.log('console1;', tick)
    };
    _.extend(Console1.prototype, Reflux.ListenerMixin);

    Console2 = function() {
        this.listenTo(store, this.output); // ERROR'D!
    }
    Console2.prototype.output = function() {
        console.log(arguments);
    };
    _.extend(Console2.prototype, Reflux.ListenerMixin);

    var c1 = new Console1();
    var c2 = new Console2();

    tickAction(currentTick++);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant