subscribe

abstract fun subscribe(action: (value: T) -> Unit)

Registers a function that will be called with the new value whenever the value of this Provider changes. If multiple threads update the value concurrently, intermediate subscriber invocations may be skipped, but the supplied value will always be the most recent one.

Registering a subscriber disables lazy evaluation of the provider.

The given value is not guaranteed to still be the current value at the time of invocation.