Interface CellIterable<TValue, TKey>

Common interface for data structures that can be passed to For.

interface CellIterable<TValue, TKey> {
    observe(insert, remove): (() => void);
}

Type Parameters

  • TValue
  • TKey

Implemented by

Methods

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