AutoRunner
Watches observables for changes. Often useful to keep things in sync (e.g. ViewModel -> UI). This is the synchronous version. See CoAutoRunner for the suspension function based version.
Given an observer, this class will automatically register itself as a listener and keep track of the observables which observer depends on.
You have to call run once to start watching.
To stop watching, you should call dispose.
Instead of instantiating an AutoRunner
directly you'll usually want to use an autoRun helper.
Parameters
The CoroutineLauncher to use.
Gets called when the observables change. Your onChange handler has to manually call run at any point (e.g. asynchronously) to change the tracked observables.
How changes should be executed/collected. Defaults to conflatedWorker.
Whether to start tracking in a background coroutine immediately.
The callback which is used to track the observables.
Constructors
Properties
Functions
Disposes the Disposable when CoroutineLauncher completes (including cancellation).
Disposes the Disposable when CoroutineContext completes (including cancellation).
Disposes the Disposable when CoroutineScope completes (including cancellation).
Disposes the Disposable when Job completes (including cancellation).