bamdmux
fun Observable<Int>.foo(state: BehaviorSubject<Any>) = concatMap { input -> with(state.value) { state.onNext(updateWith(input)) calculateValues(input).toObservable() } }