```fun Observable<Int>.foo(state: BehaviorSu...
# rx
b
Copy code
fun Observable<Int>.foo(state: BehaviorSubject<Any>) = concatMap { input ->
    with(state.value) {
        state.onNext(updateWith(input))
        calculateValues(input).toObservable()
    }
}