mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 09:49:30 +01:00
Reimplement contact chips with a recyclerview.
This commit is contained in:
committed by
Cody Henthorne
parent
4215b0391d
commit
7bd34d2b99
@@ -2,6 +2,7 @@ package org.thoughtcrime.securesms.util.rx
|
||||
|
||||
import io.reactivex.rxjava3.core.Flowable
|
||||
import io.reactivex.rxjava3.core.Scheduler
|
||||
import io.reactivex.rxjava3.disposables.Disposable
|
||||
import io.reactivex.rxjava3.processors.BehaviorProcessor
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
import io.reactivex.rxjava3.subjects.PublishSubject
|
||||
@@ -31,4 +32,10 @@ class RxStore<T : Any>(
|
||||
fun update(transformer: (T) -> T) {
|
||||
actionSubject.onNext(transformer)
|
||||
}
|
||||
|
||||
fun <U> update(flowable: Flowable<U>, transformer: (U, T) -> T): Disposable {
|
||||
return flowable.subscribe {
|
||||
actionSubject.onNext { t -> transformer(it, t) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user