NavigatingViewModel

open class NavigatingViewModel<A : NavigationAction<*>>(navigator: Navigator<A>, lifecycleSubscribables: LifecycleSubscribable) : BaseLifecycleViewModel

Default LifecycleViewModel allowing navigation.

Parameters

navigator

The Navigator handling navigation.

lifecycleSubscribables

The LifecycleSubscribable to be used by this viewModel.

Constructors

Link copied to clipboard
constructor(navigator: Navigator<A>, vararg lifecycleSubscribables: LifecycleSubscribable)

Properties

Link copied to clipboard

A StateFlow of the set of LifecycleSubscribable that are currently in use. Hook up your lifecycle to these LifecycleSubscribables where required.

Link copied to clipboard
expect val coroutineScope: CoroutineScope

CoroutineScope of the ViewModel. This scope is active until the ViewModel lifecycle is cleared.

Functions

Link copied to clipboard
fun didPause()

Function to be called when the presenting views lifecycle ends

Link copied to clipboard
fun didResume()

Function to be called when the presenting views lifecycle begins