👋
In the Decompose + MviKotlin world, is it the correct approach to inject a lambda function from the Component into the Store for actions that should trigger a navigation event or send some output?
Thanks!
a
Arkadii Ivanov
10/29/2023, 6:35 PM
Stores are usually retained via InstanceKeeper, so it may leak a component. There is a special concept for this - Labels. You can subscribe in your component and perform navigation as needed.
n
Nacho Ruiz Martin
10/29/2023, 6:41 PM
🤔 Ok, that will work. Since you only expose a set of Labels as Events to the UI, you can filter those.
Nacho Ruiz Martin
10/29/2023, 6:42 PM
Thank you
👍 1
Nacho Ruiz Martin
11/02/2023, 1:11 PM
You can add DisposableEffect(Unit) { onDispose {} } and log onDispose. It shouldn’t be called when you go back. Only called once when you go forward.