martmists
11/19/2024, 3:06 PMtoList
states it only works on finite observables. What do I do to get a snapshot state of an infinite observable? (and/or is there a way to clear elements from an observable?) Or is there a different class I should be looking at?Arkadii Ivanov
11/19/2024, 8:11 PMmartmists
11/19/2024, 9:05 PMmartmists
11/19/2024, 9:06 PMArkadii Ivanov
11/19/2024, 9:31 PMBehaviorSubject<List<T>>
and expose it as BehaviorSubject<List<T>>
. This would allow clients to subscribe for list updates and read the current state if needed. Also you can add clear()
method to clear the list (i.e. subject.onNext(emptyList())
.martmists
11/19/2024, 9:35 PMArkadii Ivanov
11/19/2024, 10:21 PM