Skip to content

Instantly share code, notes, and snippets.

@auryn31
Created July 19, 2019 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save auryn31/d98ca2930f6e7550b25ca216f243bbed to your computer and use it in GitHub Desktop.
Save auryn31/d98ca2930f6e7550b25ca216f243bbed to your computer and use it in GitHub Desktop.
class TimeProducer {
// create singleton
companion object {
val instance = TimeProducer()
}
// create public observable
val obs = Observable.interval(1, TimeUnit.SECONDS)
.map { LocalDateTime.now() }.share()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment