SharedPreferencesStateFlow

class SharedPreferencesStateFlow<V>(val flow: MutableStateFlow<V>, val put: (V) -> Unit) : MutableStateFlow<V>

SharedPreferencesStateFlow.

Since

0.5.6

Constructors

Link copied to clipboard
internal constructor(flow: MutableStateFlow<V>, put: (V) -> Unit)

Properties

Link copied to clipboard
private val flow: MutableStateFlow<V>
Link copied to clipboard
private val put: (V) -> Unit

Callback when the data in SharedPreferences needs to be updated.

Functions

Link copied to clipboard
fun getAndUpdate(function: (V) -> V): V

Updates the MutableStateFlow.value atomically using the specified function of its value, and returns its prior value.

Link copied to clipboard
fun update(function: (V) -> V)

Updates the SharedPreferencesStateFlow.value atomically using the specified function of its value.

Link copied to clipboard
fun updateAndGet(function: (V) -> V): V

Updates the MutableStateFlow.value atomically using the specified function of its value, and returns the new value.