idev0085 / react-boilerplate

0 stars 0 forks source link

What is Use of Redux thunk? #87

Open idev0085 opened 3 years ago

idev0085 commented 3 years ago

Redux Thunk is middleware that allows you to return functions, rather than just actions, within Redux. This allows for delayed actions, including working with promises. One of the main use cases for this middleware is for handling actions that might not be synchronous, for example, using axios to send a GET request. Redux Thunk allows us to dispatch those actions asynchronously and resolve each promise that gets returned.