Skip to content

Instantly share code, notes, and snippets.

@JoseAlcerreca
Created June 25, 2020 15:32
Show Gist options
  • Save JoseAlcerreca/71c80dc91114ae8bf0fcea26e17abf9a to your computer and use it in GitHub Desktop.
Save JoseAlcerreca/71c80dc91114ae8bf0fcea26e17abf9a to your computer and use it in GitHub Desktop.
<!-- Copyright 2020 Google LLC.
SPDX-License-Identifier: Apache-2.0 -->
override fun fetchWeatherFlow(): Flow<String> = flow {
var counter = 0
while(true) {
counter++
delay(2000)
emit(weatherConditions[counter % weatherConditions.size])
}
}
@Voice77777
Copy link

Grateful infinitely.
Simply, meaningfully, powerfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment