Thread
#compose
    Mehdi Haghgoo

    Mehdi Haghgoo

    1 year ago
    Is this correct?
    A MutableState only lasts in a single composition and it is lost in the next composition unless we remember it with
    remember
    .
    jim

    jim

    1 year ago
    This is no different from normal Kotlin behavior. If you initialize a local variable within a function, that local variable will get garbage collected when the function returns.
    louiscad

    louiscad

    1 year ago
    GC can trigger earlier in theory actually. It will get garbage collected when no longer needed, which might be earlier than the function returning, since 1.4.20, and that is especially for coroutines where you can have very long running suspending functions. For Composable functions though, it shouldn't make any difference since they should run very quickly.