cytoplasmic
    Preparing search index...

    Class CellMap<TKey, TValue>

    Type Parameters

    • TKey
    • TValue

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    onDelete: Emitter<TKey> = ...
    onInsert: Emitter<{ key: TKey; value: Cell<TValue> }> = ...
    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: number, item: Cell<TValue>, key: TKey) => void

        An observer that is called whenever an item is inserted.

      • remove: (index: number) => void

        An observer that is called whenever an item is removed.

      Returns () => void

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