Skip to content

Instantly share code, notes, and snippets.

@qwert2603
Created January 20, 2021 17:22
Show Gist options
  • Save qwert2603/2c75ce979e4be530fb29ca3caeb20753 to your computer and use it in GitHub Desktop.
Save qwert2603/2c75ce979e4be530fb29ca3caeb20753 to your computer and use it in GitHub Desktop.
class SomeViewModel : BaseViewModel() {
val flow = createViewModelStateFlow(0)
suspend fun load() {
flow.setValue(1)
delay(1000)
flow.setValue(flow.value + 1)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment