Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Migrate to Redux Toolkit #156

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

leosuncin
Copy link

@leosuncin leosuncin commented Aug 28, 2020

Redux toolkit is the new recommended way to work with Redux and because this is example followed by devs that use Cypress I think it would be a good idea to update the code to use it. RTK allows to write less and improve readability of code.

Thing I done:

  • Switch to slice pattern, no need to define action/reducer/selectors in separate files
  • Still use reselect's selectors
  • Update test files when needed
  • Keep the same code coverage
  • Format code with prettier (--no-semi --single-quote)

Pending ones

  • Use Redux's hooks API instead of connect/map Require react-redux >= v7.1
  • Convert class components to functional components, use hooks API

Use slice/duck structure.
Remove action types, actions, selectors, reducers.
Update Redux logic
@leosuncin
Copy link
Author

leosuncin commented Aug 28, 2020

Optional:

  • Use React Testing Library for unit test, but I didn't see jest as dependency Remove old tests
  • Upgrade React Redux to v7 and use Hook API over connect

@leosuncin leosuncin marked this pull request as ready for review August 28, 2020 21:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant