Closed mifopen closed 2 years ago
Mostly because of async nature of Logux Core (we need async to be compatible with IndexedDB).
Note, that we recommend switching to syncMap
(check API for defineSyncMap
on client and addSyncMap
on server). It provides better DX.
In Redux we have one useful guarantee: dispatch applies changes to the store synchronously. It means that we can get a new version of the state immediately after dispatching an action. But with
dispatch.local
ordispatch.sync
it's achievable only by awaiting the result of the functions which actually kills the optimistic approach of applying changes. I'm wondering was it an intentional design decision and if yes then what are the implications of applying changes synchronously (like in simpledispatch
implementation).