locke
03/13/2018, 2:21 PMmap
the BehaviorSubject
? Not trying to argue, but the above does allow values to be pushed into it? I'm not quite sure what you mean by the alternative solution.
The general goal is to have this Subject
observer listen to values of this List
, and emit filtered
versions of the List
. New to Rx, so maybe I have the structure of the way this should work setup incorrectly. It was my understanding that Subjects
act as both Observer
and Observable
.gildor
03/13/2018, 2:27 PMgildor
03/13/2018, 2:28 PMlocke
03/13/2018, 2:31 PMval observable: Observable<List<Int>> by lazy {
filterSubject.map{
it -> it.filter(filter)
}
}
And now we're retaining the Observable
, not creating more than one, and still accomplishing the goal.gildor
03/13/2018, 4:25 PMmyanmarking
03/15/2018, 4:40 PMmyanmarking
03/15/2018, 4:40 PMoverride fun observeBandConnState(emmitFirst: Boolean): Observable<Boolean> {
return protocolCallbackImpl.bandConnState
.startWith(emmitFirst, isAvailable)
.distinctUntilChanged()
.observeOn(AndroidSchedulers.mainThread())
}
myanmarking
03/15/2018, 4:40 PM