From the course: Building UI Components with Storybook: Master React Components and UI Design with Storybook for Better Efficiency

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Fetching remote API data with storage

Fetching remote API data with storage

So what I want to do to get started in this section, first things first here, I want to go back to our store and I want to point out that we created these default tasks. But in the real world, most likely we'd be working with a database, a back end. And so those tasks we would be fetching from a server. There are a lot of free placeholder data. You can go to jsonplaceholder.typecode.com and you can find all sorts of test to JSON that you can use. And so that's what we're gonna do. We're gonna actually plug into a real database here and run the fetches on Redux. I'm gonna show you how you can do that. So let's go back to our store first and foremost and make these updates so that we move away from this really basic default task structure and actually look at how we can handle remote API fetching. So at the very top where we're importing configure store and create slice, we're going to want to also bring in create async thunk, which is going to handle our fetching. Okay. The default…

Contents