Closed kagile closed 7 years ago
This is a question for RxJava, not RxAndroid. The answer will be that you need to implement it yourself though, because there's no map factory abstraction in RxJava.
I remember that I used collect()
operator for this, something like
observable.collect(() -> new ArrayMap<K,V>(), (map, v) -> map.put(toKey(v), toValue(v))
(you decide what toKey()
, toValue()
do)
@dimsuz thanks. collect()
works fine.
Is there any way to create ArrayMap instead of HashMap using toMap() in RxJava or RxAndroid?