![redux observable redux observable](https://res.cloudinary.com/practicaldev/image/fetch/s--xgex0az9--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://thepracticaldev.s3.amazonaws.com/i/nc626cv34cqbycn8315d.png)
Is dispatching normal Redux actions that are going through the normal flow. And so all of your Redux-base stays completely unaware, but it's effectively all of your React and your Dispatch. I will take that read the tweets action, do some stuff, and I will transform it into a new action that has some tweets. I'm gonna figure out all this other stuff and then I will fire a new action. It goes through the normal flow, the epic can then go like I'm making an AJAX request, and I get that. That will fire an action saying load the tweets which Redux can deal with, you can put up a loading thing. Because it means that when they hit the button saying like load the tweets. Another action spits out the other end, which is weirdly great. So a way to think about it is you've got an action, it goes into the epic. And so, an epic is a function that takes a stream of actions dispatched, and returns a new stream of actions. But I'll show you how we can hook it up all together. Which again, I'm not gonna go all the way into, I will leave it as an exercise for you.
#REDUX OBSERVABLE CODE#
It doesn't seem that way, because a lot of the complexity when we see the code is RxJS. So it uses this idea of an epic, which obviously raises the next question, what is an epic? An epic is actually bizarrely simple, even though when we look at some of the code, it's not. Is taking things that we were doing 30, 40 years ago, and building libraries around our modern frameworks. There's a bunch of fun words for all these libraries, like Redux Saga, Users Saga, as in like what is that? It's a term from the '80s, again, like a lot of front-end thought leadership. Great, so the interesting thing is all of our Redux Observable has a thing called an epic.
![redux observable redux observable](https://miro.medium.com/max/1400/1*WXHQTKaY5HeI4DUlVLNAdQ.png)
#REDUX OBSERVABLE SERIES#
You can start listening to the series of events, and much like an eventometer, you can stop listening when you're done. And then the cool thing about stream is that it's cancelable. Anything that happens over the course of time is probably a good candidate for an observable. It could be stuff off our website, it could be mouse movements, right? Where things are coming in, and this could be, for instance, things streaming in, when we hear back from the API. And observable you can think about as a stream, think about an array over the dimension of time. So Redux Observable, we should be pretty clear on the Redux part, but what is this observable? So we'll talk about enough RxJS to be dangerous, without getting kinda too deep into it.
![redux observable redux observable](https://www.freecodecamp.org/news/content/images/size/w2000/2020/03/IMG_20181012_232217-min-1.jpg)
I think we aspire to use more, there's a lot more that we want to use, but currently, baby steps. This is kinda again beyond the scope of this, we use a very limited set of RxJS.
#REDUX OBSERVABLE FULL#
I'm pretty sure we have full courses on Observables, so I will not go all the way into Observables. > Steve Kinney: Redux Observable is effectively binding Redux to RxJS in the same way that React Redux binds Redux to React. Here is an example combineEpics function: SetupĮxamples below assume that you have setup redux-observable middleware so that firebase is available within your epics.Transcript from the "Redux Observable" Lesson If you are using redux-observable, make sure to set up your redux-observable middleware so that firebase is available within your epics.