• Create a new ReactiveMap.

    Type Parameters

    • TKey
    • TValue

    Parameters

    Returns ReactiveMap<TKey, TValue>

    Example

    import { val, flatten } from "value-enhancer";
    import { reactiveMap } from "value-enhancer/collections";

    const map = reactiveMap();
    const v = val("someValue");
    const item$ = flatten(map.$, map => map.get("someKey")); // watch the item at "someKey"

    console.log(item$.value); // undefined
    map.set("someKey", v);
    console.log(item$.value); // "someValue"
    v.set("someValue2");
    console.log(item$.value); // "someValue2"