preferenceChanges
Create a Flow of change events on the Preference instance where the value emitted is the new value of the Preference.
Note: Created flow keeps a strong reference to the Preference instance until the coroutine that launched the flow collector is cancelled.
Example of usage:
preference.preferenceClicks()
.onEach { value ->
// handle value
}
.launchIn(uiScope)
Content copied to clipboard