You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 28, 2020. It is now read-only.
In a big app, with potentially a lot of actions, I want to be able to dispatch all my functions on a serialised specified or not thread. At the moment there is no "easy" way to add this functionality without writing your final implementation of Store again to just change the dispatch method.
What I'm doing in ReSwift is extend Store and create my own dispatch like this
Redux dispatch is synchronous by design.
Given you said you app has lots of actions - does it mean you have expensive logic inside your reducers?
Usually, the common good practice (citation needed) is to keep your reducers lightweight (mostly object assignments from passed actions), with complex logic moved inside the middleware which can be executed async and then dispatch another action when the asynch action completes. Such way can eliminate the need for asynchronous dispatch.
Of course it need to be synchronised, I've solved my problem, basically I've created new dispatch and subscribe top level functions which execute everything in a single thread executor.
My goal was to run everything on the same queue, different from the UI thread, which is now the case.
The only thing to remember is to run newState functions on the UI thread if necessary.
In a big app, with potentially a lot of actions, I want to be able to dispatch all my functions on a serialised specified or not thread. At the moment there is no "easy" way to add this functionality without writing your final implementation of Store again to just change the dispatch method.
What I'm doing in ReSwift is extend Store and create my own dispatch like this
I don't see any way to do that that in Kotlin and ReKotlin without writing your whole class Store again.
I'm I missing something?
The text was updated successfully, but these errors were encountered: