UNPKG

@obsidize/rx-map

Version:

ES6 Map with rxjs extensions for change detection

26 lines (25 loc) 1.11 kB
import { Observable } from 'rxjs'; import { MapStateChangeEvent } from '../events/map-state-change-event'; import { PropertySelector } from '../common/utility'; import { EntityMap } from './entity-map'; import { RxMap } from './rx-map'; /** * Combinatory entity map that uses an RxMap as the store. */ export declare class RxEntityMap<K, V, T extends RxMap<K, V> = RxMap<K, V>> extends EntityMap<K, V, T> { constructor(selectKey: PropertySelector<K, V>, store: T); /** * Generate an RxEntityMap instance with a standard (mutable) Map store. */ static mutable<K1, V1>(selectKey: PropertySelector<K1, V1>): RxEntityMap<K1, V1>; /** * Generate an RxEntityMap instance with an immutable backend store. */ static immutable<K1, V1>(selectKey: PropertySelector<K1, V1>): RxEntityMap<K1, V1>; get allChanges(): Observable<MapStateChangeEvent<K, V>>; get changes(): Observable<MapStateChangeEvent<K, V>>; destroy(): void; watchOne(key: K): Observable<V>; watchMany(keys: K[]): Observable<V[]>; watchAll(): Observable<V[]>; }