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
From the course: Building UI Components with Storybook: Master React Components and UI Design with Storybook for Better Efficiency
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Summary of Redux code and mock data from previous section4m 54s
-
(Locked)
Fetching remote API data with storage11m 17s
-
(Locked)
Fetching data with component mounting in React and error handling9m 58s
-
(Locked)
Building a screen component and wrapping React around Redux5m 4s
-
(Locked)
Using service workers in Storybook to build stories with API requests13m 56s
-
(Locked)
Feature updates with complex component pages and screens in Storybook5m 55s
-
(Locked)
Automating tests with interactions in Storybook8m 15s
-
(Locked)
Storybook Playwright automations for testing5m 34s
-
(Locked)
-