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

Make Listener/Publisher methods classes #24

Open
devinivy opened this issue Feb 2, 2016 · 0 comments
Open

Make Listener/Publisher methods classes #24

devinivy opened this issue Feb 2, 2016 · 0 comments

Comments

@devinivy
Copy link
Contributor

devinivy commented Feb 2, 2016

Listener and Publisher methods cannot act as proper mixins, as they rely on certain contextual variables– for example, publishers have a this.emitter and listeners have this.subscriptions.

Suggestions are,

  1. To privatize contextual variables (see Use of 'subscriptions' variable refluxjs#442).
  2. Extend the publisher directly from the event-emitter class.
  3. To turn the mixin-style methods into constructors with prototypes.
  4. In turn allow createStore() and createAction() to be used as classes (i.e. new Reflux.Store(), new Reflux.Action()) (see Support ES6/TypeScript classes in Stores and Action types refluxjs#444).
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

1 participant