Skip to content

Why Redux Toolkit?

Imogen Hardy edited this page May 31, 2022 · 1 revision

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.

πŸ™‹β€β™€οΈ General Information

🎨 Client-side 101

βš›οΈ React+Redux

πŸ’° Payment methods

πŸŽ› Deployment & Testing

πŸ“Š AB Testing

🚧 Helper Components

πŸ“š Other Reference

1️⃣ Quickstarts

πŸ›€οΈ Tracking

Clone this wiki locally