Closed AOrobator closed 4 years ago
Yes, calls to dispatch should be thread confined. In particular, the reducers need to be executed on the same thread. In my experience the main thread has been used and have not ran into any problems, but an optimal solution may be to do all middleware/reducers off the mainthread, and only updated the UI when subscibers are called.
Yes, enforcing a single/same thread within the library would be good to prevent race conditions. This could be done inside of the dispatch function in createStore
Should calls to Store.dispatch be thread confined? Particularly to the main/ui thread of the platform? Dealing with multi-threaded updates to State can get hairy