observeNotNullOnLifecycle

fun <T> WithState<T?>.observeNotNullOnLifecycle(lifecycleOwner: LifecycleOwner, filter: suspend (T) -> Boolean = { true }, onNext: (T) -> Unit): Job

Observes WithState of a nullable value on the lifecycle of a LifecycleOwner

Parameters

lifecycleOwner

The LifecycleOwner on which to observe.

filter

A filtering function to filter out certain values.

onNext

Action to execute when a new non-null value is observed.