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

Use of 'subscriptions' variable #442

Closed
charliematters opened this issue Dec 9, 2015 · 2 comments
Closed

Use of 'subscriptions' variable #442

charliematters opened this issue Dec 9, 2015 · 2 comments

Comments

@charliematters
Copy link

I have a Store which keeps a list of Subscriptions used by the user.

It turns out that subscriptions is a variable added by Reflux.createStore(). This is clashing with my 'subscriptions' array.

Can we keep internal variables protected some way e.g. '_subscriptions'?

@dtinth
Copy link
Contributor

dtinth commented Dec 19, 2015

None of Reflux’s store prototype property starts with an underscore, so it should be safe for you to use.

Otherwise, you can hide your internal data completely inside a closure:

const MyStore = (() => {
  const subscriptions = [ ]
  return Reflux.createStore({
    // ...
  })
})()

@devinivy
Copy link
Contributor

devinivy commented Feb 2, 2016

Moved over to reflux-core with reflux/reflux-core#24.

@devinivy devinivy closed this as completed Feb 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants