Awesome library! Have you considered offering a wa...
# mvikotlin
s
Awesome library! Have you considered offering a way to bind labels to a view? It seems like it would be nice to be able to do something like:
store.labels bindTo view
and then provide a
BaseMviView.handleLabel
or something. In an Android app, I think labels often need to be handled at the activity/fragment level and it would be nice to be able to tie them to the lifecycle.
a
Thanks for the feedback! You can pretty much do it already. Just add your own
handleLabel
method to your view and write something like
store.labels bindTo view::handleLabel
s
Oh, cool!! Didn’t notice this one!! Nice!!!
Copy code
infix fun <T> Flow<T>.bindTo(consumer: suspend (T) -> Unit)