badoo / MVIKotlin

Extendable MVI framework for Kotlin Multiplatform with powerful debugging tools (logging and time travel), inspired by Badoo MVICore library
https://arkivanov.github.io/MVIKotlin
Apache License 2.0
825 stars 66 forks source link

How to work around bootstrapper action publishing label before listener set up #314

Open dalewking opened 2 years ago

dalewking commented 2 years ago

I'm running into an issue where processing a BootStrapper action can cause a label to be published asynchronously as soon as the store is created, but it happens before I can subscribe to the labels. Outside of scrapping the bootstrapper and creating an Initialize intent I am not sure how to fix this.

arkivanov commented 2 years ago

You can opt-out from the automatic Store initialization and call its init method manually. It's available in the version 3.x. Please refer to the documentation: https://arkivanov.github.io/MVIKotlin/store.html

Also you can pass a trigger to a Store, please check the following: https://github.com/arkivanov/MVIKotlin/issues/188

dalewking commented 2 years ago

What do you foresee as the timeline for a release with this feature? If it will be released in a couple of months I will just upgrade to the alpha and to the release when it is released. If it is more like 6 months then I will probably have to switch to an Initialize intent.

dalewking commented 2 years ago

Or is there any chance of having you do a 2.1.0 release with this fix?

arkivanov commented 2 years ago

It is definitely no more than 3 months.

arkivanov commented 2 years ago

Unfortunately 2.1.0 with this change does not look possible, because it is a breaking API change.