toMap<K, V> method

Observable<Map<K, V>> toMap<K, V>({
  1. Map0<Map<K, V>>? constructor,
  2. Map1<T, K>? keySelector,
  3. Map1<T, V>? valueSelector,
})

Returns a Map from an observable sequence.

Implementation

Observable<Map<K, V>> toMap<K, V>(
        {Map0<Map<K, V>>? constructor,
        Map1<T, K>? keySelector,
        Map1<T, V>? valueSelector}) =>
    ToMapObservable<T, Map<K, V>, K, V>(
        this,
        constructor ?? () => <K, V>{},
        keySelector ?? (value) => value as K,
        valueSelector ?? (value) => value as V,
        (map, key, value) => map[key] = value);