-
Notifications
You must be signed in to change notification settings - Fork 13
Why Redux Toolkit?
Redux Toolkit is a library maintained by the Redux core team that offers a simple and strongly opinionated way to create a Redux store.
Using Redux for state management in the supporter checkouts is extremely helpful, as it allows us to maintain a single source of truth for changes that affect different aspects of a userβs checkout experience and also to send rich debug information to the back end when a purchase is made. However our 'home-grown' Redux code has become complex and difficult to maintain over the years, to the extent that it hinders our ability to meaningfully iterate on and improve the checkouts.
Redux Toolkit offers us a way to retain the benefits of Redux while significantly simplifying our code and making it easier to understand and work with. We have an extremely common use case- managing the state of a form- meaning thereβs no real reason to need to diverge from Toolkitβs opinionated defaults. It also enables us to make our state much more modular, separating different concerns rather than having complex, monolithic reducers, and to manage desired side effects of state changes in a much clearer and more discoverable way.
Redux Toolkit also works very well with TypeScript, and allows us to infer a lot of useful utility types based on the structure of the store- we can access specific types for the store, the state, and dispatch
rather than needing to construct them repeatedly from generics and keep them up to date throughout the codebase if the structure of the store changes.
- Redux Glossary
- Why Redux Toolkit?
- Writing state slices with Redux Toolkit
- Handling action side effects in Redux
- Presentational and Container Components
- Scoped actions and reducers
- Server Side Rendering
- Form validation
- CI build process
- Post deployment testing
- Post deployment test runbook
- TIP Real User Testing
- Code testing and validation
- Visual testing
- Testing Apple Pay locally
- Test Users
- Deploying to CODE
- Automated IT tests
- Deploying Fastly VCL Snippets
- Archived Components
- Authentication
- Switchboard
- How to make a fake contribution
- The epic and banner
- Environments
- Tech stack
- Supported browsers
- Contributions Internationalisation
- Payment method internationalisation in Guardian Weekly
- Print fulfilment/delivery
- Updating the acquisitions model
- Runscope testing
- Scala Steward for dependency management
- Alarm Investigations
- Ticker data
- Ophan
- Quantum Metric
- [Google Tag Manager] (https://github.com/guardian/support-frontend/wiki/Google-Tag-Manager)