-
Notifications
You must be signed in to change notification settings - Fork 428
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
refactor: upgrade + optimise Redux #1981
Conversation
Branch preview✅ Deploy successful! |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
I like the better type support and reduced nesting with the new middleware.
@@ -90,7 +88,10 @@ export const _hydrationReducer: typeof rootReducer = (state, action) => { | |||
const makeStore = (initialState?: Record<string, any>) => { | |||
return configureStore({ | |||
reducer: _hydrationReducer, | |||
middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: false }).concat(middleware), | |||
middleware: (getDefaultMiddleware) => { | |||
listeners.forEach((listener) => listener(listenerMiddlewareInstance)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a difference in registering the listeners in this function or on the top level? In the examples from the documentation they are registered on the top level right after the middleware is created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so.
I moved it here as this is just before store creation/allowed for better testing. What are your thoughts?
LGTM Checked that sidebar updates with the safes, new safes created, added safes, owned safes in new networks |
@iamacook please don't merge just yet, let's create an RC w/o it first. |
What it solves
Upgrades Redux to the latest version and optimises/improves type safety of middlewares.
How this PR fixes it
react-redux
and@reduxjs/toolkit
have been upgraded to the latest versions.createListenerMiddleware
How to test it
No visible changes should be noticed:
Checklist