Search code examples
javascriptreactjsreact-nativereduxreact-redux

Is there a react redux dispatch schedule?


I need to know, when i call something like:

dispatch(firstStuff());
dispatch(secondStuff());

if there is something like a schedule in react-redux, that gives me the guaranty, that these 2 lines will be dispatched in the right sequence. Or is it possible that if my app has a small frame brake-in for example, it will be dispatched in a different order?

Thank you for any answere


Solution

  • No, since these dispatches are not being scheduled in any way, but executed immediately. So if dispatching a normal action, the reducers will execute immediately before the next line (and thus, dispatch) is executed.

    If those are thunks, they will be started immediately, but if you go any type of async, of course from there it can go all directions.