Transcript

Instructor: 0:00 Let's talk about useCallback. We're going to make a custom hook. Often, you'll find that when you're making custom hooks, you have to use memoization techniques like useCallback.

0:09 In the background here, feel free to read through this. I explained what the use case of useCallback is. You can read through that, get a good idea of the API and the use cases. Make sure to not skip over this blog post where I talked about why you shouldn't use useCallback everywhere and use it more surgically.

0:27 Once you've gotten through that, you can jump into the exercise, which might look a little familiar to you. Haha. Hey, Pikachu. In this exercise, we already have everything working with useReducer. Your job is to move things around so you can make a custom hook.

0:43 You'll find that in the process of making the custom hook to manage this asynchronous flow, you're going to need to do some fancy things with your dependencies. In the extra credit, we're going to use useCallback to make those fancy things a little less confusing and problematic.

1:00 Then we have some additional extra credits that you can use to make things even better. Have fun with that, and we'll see you on the other side of the exercise.