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

Package mozilla.components.lib.state.ext

Functions

Name Summary
observe fun <S : State, A : Action> Store<S, A>.observe(owner: LifecycleOwner, observer: Observer<S>): Unit
Registers an Observer function that will be invoked whenever the state changes. The Store.Subscription will be bound to the passed in LifecycleOwner. Once the Lifecycle state changes to DESTROYED the Observer will be unregistered automatically.fun <S : State, A : Action> Store<S, A>.observe(view: <ERROR CLASS>, observer: Observer<S>): Unit
Registers an Observer function that will be invoked whenever the state changes. The Store.Subscription will be bound to the passed in View. Once the View gets detached the Observer will be unregistered automatically.
observeForever fun <S : State, A : Action> Store<S, A>.observeForever(observer: Observer<S>): Unit
Registers an Observer function that will observe the store indefinitely.