iamthevoid

    iamthevoid

    1 year ago
    Is there some kind
    onDestroyView
    for composable? For example here listed example when viewModel value assigning as default parameter in composable function by
    viewModel()
    call. If i understand correct this factory creates (or returns) view model from activity or fragment scope. But what if i develop single activity app with huge number of features on billions screens? Should i use activity view model scope or i must include fragments to my code or there is better way to handle memory in compose?
    i want any composable-related scope that will be destroyed after view goes out from stack
    Daniel

    Daniel

    1 year ago
    You can scope viewmodels to navigation destinations which are composables instead of fragments
    iamthevoid

    iamthevoid

    1 year ago
    Checked that.
    onCleared
    calls when composable goes out from screen, it is perfect!
    Thanks
    Daniel

    Daniel

    1 year ago
    cool