mwg API
    Preparing search index...

    Function takeLastEntries

    • The newest count entries of a retained log, oldest first. Pure so the readback contract is testable without a renderer: a count of 0 (or negative) reads nothing, a `count past what is retained reads everything retained.

      Type Parameters

      • T

      Parameters

      • entries: readonly T[]
      • count: number

      Returns T[]

      import { takeLastEntries } from '@datamoc/mwg/two-d/ui';

      console.log(takeLastEntries(['a', 'b', 'c'], 2)); // ['b', 'c']