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

Store function name is significant #16

Closed
gaearon opened this issue Jun 3, 2015 · 0 comments
Closed

Store function name is significant #16

gaearon opened this issue Jun 3, 2015 · 0 comments

Comments

@gaearon
Copy link
Contributor

gaearon commented Jun 3, 2015

A lot of problems were solved in 0.3 rewrite but unfortunately the Store function name is now significant. It is used as the key to the related state partition. Because Stores are not registered anywhere, there are a couple of weird problems:

  • Until some component references a Store, its data doesn't exist and it doesn't receive actions. Bad.
  • If you add another Store with the same function name they'll refer to the same data. Oops.

We can't rely on the function identity because of hot reloading. The same Store will he represented by different functions over time.

I feel this calls for a "Store registry" where you'd assign a unique key to each Store. I can't pinpoint the API yet so let's leave this open. If you have suggestions please let me know.

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

1 participant