https://kotlinlang.org logo
#decompose
Title
# decompose
n

Nacho Ruiz Martin

10/29/2023, 6:08 PM
👋 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.
Thank you
👍 1
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.
This is exactly what’s happening 😅 .
👍 1
Wrong thread, sorry!
3 Views