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

Docs: More Style Guide entries #3759

Closed
3 tasks done
markerikson opened this issue Apr 29, 2020 · 8 comments
Closed
3 tasks done

Docs: More Style Guide entries #3759

markerikson opened this issue Apr 29, 2020 · 8 comments

Comments

@markerikson
Copy link
Contributor

markerikson commented Apr 29, 2020

What docs page is being added or updated?

  • Section: Style Guide
  • Page: Style Guide

For Updating Existing Content

What updates should be made to the page?

Some additional items I'd like to add:

  • Organize reducers based on type of data and features, not specific components
  • Use hooks as the default, instead of connect
  • Name state slices after their data, without the word reducer in the name (ie, state.users, not state.usersReducer)

Any others we should add?

@tony-go
Copy link

tony-go commented Apr 29, 2020

Is slice usage should not be the default usage? Or toolkit usage should stay in redux-toolkit doc only?

@markerikson
Copy link
Contributor Author

@tony-go Not sure what you're asking. Can you clarify?

@tony-go
Copy link

tony-go commented Apr 29, 2020

Sorry 🙈 !

As items to add, you do you think about to use createSlice (toolkit) as default usage?

In this section => https://redux.js.org/basics/reducers

@markerikson
Copy link
Contributor Author

@tony-go We have separate plans to rewrite the tutorial sequence later. See #3592 .

This issue is just about adding specific new entries to the Style Guide page.

@markerikson
Copy link
Contributor Author

Per reduxjs/redux-toolkit#521 , possibly add a recommendation for the no-param-reassign ESLint rule to avoid people doing state = newValue in RTK reducers?

@Luchanso
Copy link

Recommendation like 'no-param-reassign': ['error', { props: true, ignorePropertyModificationsFor: ['state'] }], this will ignore rule for state variable

@markerikson
Copy link
Contributor Author

@Luchanso Nice, thanks for the suggestion!

@markerikson
Copy link
Contributor Author

Going to mark this as resolved. I don't think we specifically should add the no-param-reassign thing in the style guide, but I'll mention it in the RTK "Writing Reducers with Immer" usage guide.

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