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

Update Store.md #1608

Closed
wants to merge 1 commit into from
Closed

Update Store.md #1608

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 13, 2016

Because I spent ages looking at middleware alternatives when I hadn't thought to do this: http://stackoverflow.com/questions/35305661/where-to-write-to-localstorage-in-a-redux-app.

Because I spent ages looking at middleware alternatives when I hadn't thought to do this: http://stackoverflow.com/questions/35305661/where-to-write-to-localstorage-in-a-redux-app.
@mxstbr mxstbr added the docs label Apr 13, 2016
@gaearon
Copy link
Contributor

gaearon commented Apr 14, 2016

To be honest I don’t think this is particularly discoverable here.

In 95% of the cases subscribe() is used to update the UI (although higher level libraries like React Redux tend to abstract over its usage) so saying this is why it exists might give the wrong impression.

Maybe rewording it to something like

It is most often used to update the UI in response to the state changes. Libraries like React Redux provide higher level abstractions on top of it but you can always use it directly, too. One common use case for it is to persist some parts of the current state into the localStorage on every change.

@ghost
Copy link
Author

ghost commented Apr 15, 2016

Yes, I agree about the discoverability. I've created a new PR for the gist code on the front page. I guess this could also be something for the egghead videos.
I agree with your rewording for here.

@gaearon
Copy link
Contributor

gaearon commented Apr 21, 2016

Closing in favor of #1620.

@gaearon gaearon closed this Apr 21, 2016
gaearon pushed a commit that referenced this pull request May 3, 2016
* use subscribe to persist to localStorage

more discoverable than #1608

* Clearer wording
seantcoyote pushed a commit to seantcoyote/redux that referenced this pull request Jan 14, 2018
* use subscribe to persist to localStorage

more discoverable than reduxjs#1608

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

Successfully merging this pull request may close these issues.

2 participants