MVIKotlin icon indicating copy to clipboard operation
MVIKotlin copied to clipboard

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

Open dalewking opened this issue 4 years ago • 5 comments

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.

dalewking avatar Dec 07 '21 21:12 dalewking

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

arkivanov avatar Dec 07 '21 21:12 arkivanov

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 avatar Dec 07 '21 21:12 dalewking

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

dalewking avatar Dec 07 '21 21:12 dalewking

It is definitely no more than 3 months.

arkivanov avatar Dec 07 '21 21:12 arkivanov

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

arkivanov avatar Dec 07 '21 21:12 arkivanov