I would like to know if there is any best option to do a time consuming network request as a background task in react component.
For example, I have to load a component where it is accessible to the user but in background i have to hit some high intensive network request for future loading and results of same has to be updated in redux store(Using react-redux). It would be really helpful if someone share some ideas on this. Thanks in advance.
One of the ways is to create action creators that will perform any task, regardless of sync or async and update the store accordingly. Redux-thunk is the middleware that can help you to achieve this.
https://github.com/gaearon/redux-thunk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With