Last active
March 12, 2024 14:28
-
-
Save tdcolvin/6015a34c0887e24d23582667055e17b7 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
val sharedFlow = MutableSharedFlow<Int>() | |
viewModelScope.launch { | |
var count = 0 | |
// Every 500ms, emit a new number in sequence | |
while (true) { | |
delay(500) | |
sharedFlow.emit(count++) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment