android-components / mozilla.components.lib.state.helpers

Package mozilla.components.lib.state.helpers

Functions

Name Summary
onlyIfChanged fun <S : State, T> onlyIfChanged(onMainThread: Boolean = false, map: (S) -> T?, then: (S, T) -> Unit, scope: CoroutineScope = GlobalScope): Observer<S>
Creates an Observer that will map the received State to T (using map) and will invoke the callback then only if the value has changed from the last mapped value.