MVICore icon indicating copy to clipboard operation
MVICore copied to clipboard

Handle SingleLiveEvents like Snackbar

Open nikiJava opened this issue 5 years ago • 3 comments

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 avatar May 17 '19 18:05 nikiJava

@nikiJava you can find what you are looking for in the documentation: https://github.com/badoo/MVICore/blob/master/documentation/features/news.md

zsoltk avatar May 17 '19 23:05 zsoltk

@zsoltk I saw the sample and there NewsListener is used. But what about snackbars? It needs view. Will you inject view inside NewsListener?

nikiJava avatar May 26 '19 17:05 nikiJava

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.

zsoltk avatar May 27 '19 02:05 zsoltk