1

Search many forum but still confuse, redux is async or sync?? Realize this is a basic question but I had no luck finding the answer elsewhere. if any one know describe with examples.

2 Answers 2

3

Redux store only supports synchronous data flow (ref).

This is what you get by default with createStore().

Asynchronous middleware like redux-thunk or redux-promise wraps the store's dispatch() method and allows you to dispatch something other than actions, for example, functions or Promises. Any middleware you use can then interpret anything you dispatch, and in turn, can pass actions to the next middleware in the chain.

For example,

a Promise middleware can intercept Promises and dispatch a pair of begin/end actions asynchronously in response to each Promise.

Read More>>

Sign up to request clarification or add additional context in comments.

Comments

0

Dispatching actions is synchronous in Redux.

Without middleware, Redux store only supports synchronous data flow. This is what you get by default with createStore().

For asynchronous actions, you can use applyMiddleware(), for middlewares such as redux-thunk.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.