observeForever

expect open fun observeForever(observer: Observer<in T>)

Observe the data object forever.

The data object will notify its Observer in the following scenarios:

  1. When the observation starts: LiveData.observe.

  2. When the Observer moves from not observing to observing.

  3. When the value changes: LiveData.getValue.

Parameters

observer

The object observing the change.

See also