Saga let's us set up a generator function to intercept dispatched action object. Pause until we have the data and then dispatch the another action with the data to modify the UI. Saga sits in the middle listening to actions
A normal function cannot be paused or stopped before its execution is completed, once it finishes execution and returns a value, that execution context is gone.
Generators are functions that can return or
yield values in between without exiting the current context. These functions can be paused in between and wait a while until they are needed to be called. Once it's paused/stopped, it can continue from that same place again, resuming in its current context.
Generators help us in writing async code.
You can pass in more data while the generator is going. When you call
Sometimes we need to wait a bit for information!
Async Await is a syntactic sugar on Generators.
call is a method in Redux Saga used for calling functions
put is used for emitting events / actions
take waits for an action to be emitted before going further, the function waits for this specific action to be intercepted