optic

fun <T, A> SharedFlow<T>.optic(g: Lens<T, A>): SharedFlow<A>

Exposes the values of this through the optic.


fun <T, A> StateFlow<T>.optic(g: Lens<T, A>): StateFlow<A>

Exposes the values of this through the optic.


fun <T, A> MutableStateFlow<T>.optic(lens: Lens<T, A>): MutableStateFlow<A>

Exposes the values of this through the optic. Any change made to value is reflected in the original MutableStateFlow.


fun <T, A> State<T>.optic(g: Lens<T, A>): State<A>

Exposes the value of this through the optic.


fun <T, A> MutableState<T>.optic(lens: Lens<T, A>): MutableState<A>

Exposes the value of this through the optic. Any change made to value is reflected in the original MutableState.