Redux Workshop, 2021-05-05

Steve Kinney
May 05, 2021
2.3k

Redux Workshop, 2021-05-05

Steve Kinney

May 05, 2021

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

9 slides
  1. What’s in this workshop? Oh, the topics we’ll cover! Redux

    without React—or anything, really Integrating Redux with React Hooks Creating Higher Order Components with the Connect API Using Redux Toolkit Working with Asynchronous Actions
  2. Some Rules for Reducers Disobey at your own peril. •

    No mutating objects. If you touch it, you replace it. • You have to return something and ideally, it should be the unchanged state if there is nothing you need to do it. • It’s just a JavaScript function.
  3. Prefer Flat Objects const angryBlogPost = { title: 'A letter

    to the editor', content: 'I am very salty about…', author: { firstName: 'Steve', lastName: 'Kinney', location: { city: 'Denver', }, }, };
  4. Prefer Flat Objects if (action.type === 'CITY_CHANGED') { return {

    ...state, author: { ...state.author, location: { city: action.payload, }, }, }; }

More Decks by Steve Kinney