Does anyone have experience adding async features ...
# redux
b
Does anyone have experience adding async features to the Store via coroutines? We have some calls to dispatch coming from a coroutine living in a fragment lifecycleScope, if the developer called dispatch and navigate to a different fragment, the dispatch call gets cut short. My thought was to offer a new dispatchAsync method using the application scope so it outlives the fragment scope, and then from the Store, for safety, the store calls back to the subscribers with a new launch to default back to the main thread, as most of the subscribers are assuming they are being called on Main.
perhaps a runBlocking instead of that last launch, in the case of 'Managed Middleware' like the question above
b
Looks like you need thunks for that
b
Thanks Martynas, that might come in handy but I was thinking more about outside of middleware. Getting off the fragment lifecycle and calling out to subscribers.
b
Ah, i see. No clue then.