MVICore
MVICore copied to clipboard
Handle SingleLiveEvents like Snackbar
Hello, Guys! Would you provide simple example on how to show Snackbar? Is it SingleLiveEvent? Or you just put the state of Snackbar into your feature's ViewState?
@nikiJava you can find what you are looking for in the documentation: https://github.com/badoo/MVICore/blob/master/documentation/features/news.md
@zsoltk I saw the sample and there NewsListener is used. But what about snackbars? It needs view. Will you inject view inside NewsListener?
The NewListener
is not the important part, not even a suggested usage, just an example. Feel free to not have it at all. The important part is only that you can use the .news
output of the Feature
too, not just its states. What you do with the news stream, where you bind it, is up to you. You can merge it into the view model for example, if that helps.