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 style-guide.md #3700

Merged
merged 2 commits into from
Feb 16, 2020
Merged

Update style-guide.md #3700

merged 2 commits into from
Feb 16, 2020

Conversation

davidkpiano
Copy link
Contributor

@davidkpiano davidkpiano commented Feb 16, 2020

Add detailed docs for #3692

PR Type

Does this PR add a new page, or update an existing page?

Checklist

What docs page is being added or updated?

https://redux.js.org/style-guide/style-guide/#treat-reducers-as-state-machines

For Updating Existing Content

What updates should be made to the page?

Adding detailed explanation for "Treat Reducers as State Machines"

Do these updates change any of the assumptions or target audience? If so, how do they change?

No

Add detailed docs for reduxjs#3692
@netlify
Copy link

netlify bot commented Feb 16, 2020

Deploy preview for redux-docs ready!

Built with commit 6a0b6a1

https://deploy-preview-3700--redux-docs.netlify.com

@markerikson
Copy link
Contributor

Sweet, thanks!

My one stylistic nitpick is that I'm generally trying to move our examples away from hardcoded constants and switch statements, but other than that, nice explanation with a good example.

I briefly debated asking for a side-by-side comparison of implementing the same logic via both a "state-first" and "action-first" approach, but we can save that for a longer docs page. I want to keep the "Style Guide" page shorter and focused overall.

@markerikson markerikson merged commit 4a02b1a into reduxjs:master Feb 16, 2020
@davidkpiano
Copy link
Contributor Author

I'm generally trying to move our examples away from hardcoded constants and switch statements

I'd like to do that; how would you suggest I refactor my example with that in mind?

@markerikson
Copy link
Contributor

Erm... that's a good question, really.

Problem is, that's primarily a createSlice thing, which is of course action-type-oriented, and going for any kind of a state machine abstraction is probably more distracting than helpful for the code example in this specific page.

Totally fine with showing, say, "baby's first FSM abstraction" in the larger docs page (as well as the obvious mentions of the small and full XState libs as full-blown solutions in that page as well).

webMasterMrBin pushed a commit to webMasterMrBin/redux that referenced this pull request Aug 21, 2021
* Update style-guide.md

Add detailed docs for reduxjs#3692

* Update style-guide.md


Former-commit-id: 2ce7391
Former-commit-id: 7d857cc
webMasterMrBin pushed a commit to webMasterMrBin/redux that referenced this pull request Aug 21, 2021
* Update style-guide.md

Add detailed docs for reduxjs#3692

* Update style-guide.md


Former-commit-id: 2ce7391
Former-commit-id: 7d857cc
webMasterMrBin pushed a commit to webMasterMrBin/redux that referenced this pull request Aug 21, 2021
* Update style-guide.md

Add detailed docs for reduxjs#3692

* Update style-guide.md


Former-commit-id: 2ce7391
Former-commit-id: 7d857cc
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

Successfully merging this pull request may close these issues.

2 participants