Is store.dispatch in Redux synchronous or asynchronous

后端 未结 2 649
耶瑟儿~
耶瑟儿~ 2020-11-27 19:41

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

Is store.dispatch synchronous or asynchronous in Redux ?

2条回答
  •  广开言路
    2020-11-27 20:05

    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?

提交回复
热议问题