dev-null dev-null - 3 years ago 160
Javascript Question

Is store.dispatch in Redux synchronous or asynchronous

I realize this is a basic question but I had no luck finding the answer elsewhere.

Is

store.dispatch
synchronous or asynchronous in
Redux
?

In case it is asynchronous is there a possibility to add a callback after the action has been propagated as it is possible with
React
?

Answer Source

AFAIK, dispatching action is synchronous. In case if you are willing to address the asynchronous call, you can use the thunk-middleware in redux, where dispatch is provided as a callback function which you can invoke as per your convenience. For more info, checkout this answer on SO by Author itself: How to dispatch a Redux action with a timeout?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download