Package com.skydoves.viewmodel.lifecycle.coroutines

Functions

Link copied to clipboard
fun ViewModelLifecycleOwner.viewModelLifecycleFlow(): Flow<ViewModelState>

Add an observer and observes continuously a ViewModelState from the ViewModelLifecycleOwner.

Link copied to clipboard
fun ViewModelLifecycleOwner.viewModelOnClearedFlow(): Flow<Unit>

Add an observer and get notified only once when the ViewModel is cleared. The observer will be removed from the ViewModelLifecycle once get notified.

Link copied to clipboard
fun ViewModelLifecycleOwner.viewModelOnInitializedFlow(): Flow<Unit>

Add an observer and get notified only once when the ViewModel is initialized. The observer will be removed from the ViewModelLifecycle once get notified.