observe

fun observe(observer: Consumer<M>): Disposable

Add an observer of model changes to this loop. If mostRecentModel is non-null, the observer will immediately be notified of the most recent model. The observer will be notified of future changes to the model until the loop or the returned Disposable is disposed.

Return

a Disposable that can be used to stop further notifications to the observer

Parameters

observer

a non-null observer of model changes

Throws

if the loop has been disposed