Jul 2, 2019 in React JS
Q:

What is Redux Thunk used for?

1 Answer

0 votes
Jul 2, 2019

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()

Related questions

0 votes
0 votes
0 votes
Jun 19, 2020 in React JS
0 votes
Jun 19, 2020 in React JS
...