Advanced State Management With Redux
Submitted by Ankur Sethi (@s3thi) on Monday, 15 August 2016
A talk covering advanced patterns and common state-management scenarios in a Redux-powered application.
Redux is the best. It’s better than Rihanna’s new album, better than Pokémon Go, and better than Obama’s summer playlist.
Actually, I lied. Nothing is better than Rihanna’s new album. But if you’ve ever written a reasonably complex React application, you know that state management is a pain in the butt and that Redux makes all the pain and complexity go away, which makes it at least second best.
However, adding Redux to your app often raises a ton of questions that are not always answered in the documentation.
- How do I reduce boilerplate when writing my reducers?
- Should I normalize the data I receive from my REST API before putting it in my store? Why? Why not?
- If I normalize my data, I have a hard time querying it before I pass it to my components. What do?
- How does Redux work with localStorage? HTML5 history?
- I’m trying to add a feature to my app that requires 5 API calls, each one depending on the result of the previous call. What’s the best way of expressing this workflow with Redux?
- How do I handle and keep track of server errors? Form errors? Global notifications?
- What is a Redux middleware? How do I write one?
- What is a store enhancer? How do I write one?
- What’s the best song on ANTI and why is it Work?
This talk aims to address common Redux questions, best practices, and pitfalls. I’ll demonstrate working code examples, explain why things work the way they do, and throw in a couple of Kanye West memes for free.
- Experience with building front-end applications using React.
- Experience with using a state management library with React (Redux, MobX, or any implementation of Flux).
He has worked on everything from filesystems to mobile games, but his first love has always been the web platform.