Class CellMap<TKey, TValue>

Type Parameters

  • TKey
  • TValue

Hierarchy (view full)

Constructors

Properties

_onDelete: MutEmitter<TKey> = ...
_onInsert: MutEmitter<{
    key: TKey;
    value: Cell<TValue>;
}> = ...

Type declaration

cells: MutCell<Map<TKey, MutCell<TValue>>> = ...
initialEntries: Iterable<[TKey, TValue]> = []
onDelete: Emitter<TKey> = ...
onInsert: Emitter<{
    key: TKey;
    value: Cell<TValue>;
}> = ...

Type declaration

size: Cell<number> = ...

Accessors

  • get indexed(): CellStream<TItem, Cell<number>>
  • Create a stream that assigns an index, starting at 0, to eachitem in this stream. The indices are cells that will update when items are removed.

    Returns CellStream<TItem, Cell<number>>

    A new stream.

Methods

  • Observe this iterable. Upon attaching an observer insert is called for each item currently contained in the underlying collection.

    Parameters

    • insert: ((index, item, key) => void)

      An observer that is called whenever an item is inserted.

        • (index, item, key): void
        • Parameters

          Returns void

    • remove: ((index) => void)

      An observer that is called whenever an item is removed.

        • (index): void
        • Parameters

          • index: number

          Returns void

    Returns (() => void)

    A function that should be called to detach the observer functions.

      • (): void
      • Returns void

  • Type Parameters

    • T

    Parameters

    • key: TKey
    • mutator: ((value) => T)
        • (value): T
        • Parameters

          Returns T

    Returns undefined | T