When working with external data, you need to deal with external factors, such as the network or disk. These factors influence your code, so it needs to be asynchronous. Also, you should strive to decouple it from your predictable parts, as a network is unpredictable and may fail. We call such things side effects and you have already learned a little about them already.
To understand this, I would like to introduce a big word: effect.
"We yield plain JavaScript Objects [...]. We call those Objects Effects. An Effect is simply an object that contains some information to be interpreted by the middleware. You can view Effects like instructions to the middleware to perform some operation (e.g., invoke some asynchronous function, dispatch an action to the store, etc.)."
- From the Redux Saga official documentation, which can be found at:
https://redux-saga...
- From the Redux Saga official documentation, which can be found at:
https://redux-saga...