in React JS by

What is Redux Thunk used for?

▼ Show 1 Answer

0 votes

Redux thunk is middleware that allows us to write action creators that return a function instead of an action. The thunk can then be used to delay the dispatch of an action if a certain condition is met. This allows us to handle the asyncronous dispatching of actions. The inner function receives the store methods dispatch and getState as parameters.

To enable Redux Thunk, we need to use applyMiddleware()

React JS
Learn More with Madanswer

Related questions

0 votes
0 votes
0 votes
asked Jun 19, 2020 in React JS by JackTerrance