1 min read

Redux Thunk

An action creator that returns a function to perform asynchronous dispatch. A thunk is a function that wraps an expression to delay its evaluation.
Redux Thunk

A thunk is a function that wraps an expression to delay its evaluation.

Redux Thunk middleware allows you to write action creators that return a function instead of an action. The thunk can be used to delay the dispatch of an action, or to dispatch only if a certain condition is met. The inner function receives the store methods dispatch and getState as parameters.

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.

https://www.cronj.com/blog/wp-content/uploads/New-Project.png
redux-thunk
Thunk middleware for Redux.
https://www.npmjs.com/package/redux-thunk

#Redux #Middleware #Dispatch #Probyto #ProbytoAI

Subscribe & Follow us for latest in field of AI & Tech and stay updated!
Facebook: https://facebook.com/probyto
Twitter:https://twitter.com/probyto
LinkedIn: https://linkedin.com/company/probyto
Instagram:https://instagram.com/probyto