package com.ponzischeme89.memby.ui

import androidx.lifecycle.ViewModelStore
import androidx.lifecycle.ViewModelStoreOwner

/**
 * A lifecycle boundary for state that belongs to one signed-in Emby profile.
 *
 * The owner is remembered by the profile screen and cleared when that screen leaves
 * composition. Clearing it cancels the old profile's ViewModel jobs as well as dropping
 * its rows and caches before another profile is rendered.
 */
internal class ProfileViewModelStoreOwner : ViewModelStoreOwner {
    override val viewModelStore = ViewModelStore()

    fun clear() {
        viewModelStore.clear()
    }
}
