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

Create stateful dispatchers #10

Open
AsafRosen opened this issue Nov 9, 2015 · 1 comment
Open

Create stateful dispatchers #10

AsafRosen opened this issue Nov 9, 2015 · 1 comment

Comments

@AsafRosen
Copy link
Contributor

Allow creating stateful dispatchers so that a change in the stateful dispatcher will propegate to all children of the stateful dispatcher.

e.g.

var rootDispatcher = new StatefulDispatcher(\*...*\); 

var childDispatcher = rootDispatcher.createScoped("SomeScreen"); 

rootDispatcher.setIdentity("User ID", "123"); 
rootDispatcher.setDispatchMethod(function(event) { console.log(event) } ); 

childDispatcher.dispatch("View"); // Will write to the console view event with User ID: 123

This will allow apps to create a root dispatcher and set its' behavior/dispatching method.

@Yshayy
Copy link
Contributor

Yshayy commented Nov 9, 2015

I think it's a property of the state (mutability), not the the dispatcher

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

No branches or pull requests

2 participants