Is there an easy way to wrap a `MutableStateFlow` ...
# flow
m
Is there an easy way to wrap a
MutableStateFlow
so that I can do something with new values before they are sent downstream? E.g.
Copy code
fun <Value: Any> persistedFlow(key: String, serializer: KSerializer<Value>): MutableStateFlow<Value?> =
	save(MutableStateFlow(value = load(key, serializer)), key, serializer)
How would I implement
save
? According to the docs:
The
MutableStateFlow
interface is not stable for inheritance in 3rd party libraries (…)
g
Well, if you need stable api in your library you cannot implement MutableStateFlow