Add redux-observable to an existing Redux project

Shane Osbourne
InstructorShane Osbourne

Share this video with your friends

Send Tweet
Published 4 years ago
Updated 3 years ago

In this lesson we’ll learn exactly what’s needed to incorporate redux-observable into an existing React/Redux application. We’ll learn what ‘Epics’ are, how to register & combine them - and finally how to create the Redux Middleware that ties it all together

Instructor: [00:00] Go to this GitHub repo and select the appropriate installation method for your browser. Once you have the extension, as I do here, we need to look for the code that will enable it. We need the advanced store setup since we are using other middleware. We can copy this line. Inside our configure store area, we can paste that line in.

[00:37] What this is doing is it's looking if the DevTools extension is available on the window. If it isn't, we'll fall back to this compose method. We need to import this from Redux. Then we simply wrap the call to applyMiddleware in the call to composeEnhancers. Go back to the browser.

[01:05] Now you can see this has gone green. If you don't see it as a separate tab, you may need to close DevTools and reopen it. Then you can see we have this Redux panel. Now we can see a log of all of the actions that occur in our application.