Skip to content

Instantly share code, notes, and snippets.

@akio0911
Created July 2, 2020 14:37
Show Gist options
  • Select an option

  • Save akio0911/bf98791077978f3b9c1d4a1e8a1a65d4 to your computer and use it in GitHub Desktop.

Select an option

Save akio0911/bf98791077978f3b9c1d4a1e8a1a65d4 to your computer and use it in GitHub Desktop.
Observable
.merge(
stringStream.map { Value.string($0) },
intStream.map { Value.int($0) }
)
.debounce(.seconds(1), scheduler: MainScheduler.instance)
.subscribe(onNext: {
switch $0 {
case let .string(string):
print(string)
case let .int(int):
print(int)
}
})
.disposed(by: disposeBag)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment