I think I'll go with this one: ``` val shared = ob...
# rx
k
I think I'll go with this one:
Copy code
val shared = observable.share()

val threshold = 6
val badValues = shared.filter { it < threshold }
val goodValues = shared.filter { it >= threshold }

val alerts = badValues
        .flatMap {
            Observable.amb(
                    Observable.timer(3000, TimeUnit.MILLISECONDS).map { Alert() },
                    goodValues.map { null }.first()
            )
        }
        .filter { it != null }