Last active
February 9, 2023 17:09
-
-
Save EmmanuelGuther/86ecf39e259d525371b7f279ef4abb9a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Viewmodel--> | |
private var _data: Channel<PagingData<Event>> = Channel() | |
var data = _data.receiveAsFlow() | |
fun callApiExample(){ | |
usecaseFoo... .collect{ _data.send(it)} | |
} | |
Fragment--> | |
lifecycleScope.launchWhenStarted { | |
repeatOnLifecycle(Lifecycle.State.STARTED) { | |
vm.data.collect { events -> | |
pageOne.data(events) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment