processing / processing/p5.js-web-editor
Refactoring Redux code: hooks, thunks, and redux-toolkit
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 1.7k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 8
Description
Most of the Redux code is this package was written years ago and has not been touched since. In that time, Redux has come a long way! The bad news is that this codebase goes against a lot of the Redux Best Practices. The good news is that the newer ways of doing things are much easier and involve a lot less boilerplate.
Some things which can be improved/changed:
- Can use
createSlicewhich automatically creates the action creators for a reducer so that you don't need to define a bajillion constants or define basic action creator functions. This can be tackled one "slice" at a time, as Redux Toolkit is fully compatible with old/vanilla Redux. - Can use
createAsyncThunkto automatically dispatchpending,errorandfulfilledactions for each asynchronous action. - Can use
useSelectoranduseDispatchhooks instead of theconnectHOC.
I can do a lot of this myself, but I wanted to post it as a discussion first because I don't want to waste time rewriting code if it's not wanted.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue identifies the Redux codebase and constants.js but does not name a specific reducer, test, or entry point. Start by reviewing those areas against the linked Redux Best Practices, then clarify the intended slice or migration scope; done would require an agreed, tested modernization plan.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, redux
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100