Options
All
  • Public
  • Public/Protected
  • All
Menu
description

A nonempty list that will always have one element selected

NOTE For size and performance reasons, the public properties are not truly immutable, meaning they can be reassigned, but doing so will result in unexpected behavior due to mutations made to internal state. Please treat them as readonly — as intended

Type parameters

  • a

Hierarchy

  • SelectListImpl

Index

Constructors

Properties

Methods

Constructors

constructor

  • new SelectListImpl(before: a[], selected: a, after: a[]): SelectListImpl

Properties

after

after: a[]
description

The elements currently in the after section of the SelectList

before

before: a[]
description

The elements currently in the before section of the SelectList

selected

selected: a
description

The currently selected element

size

size: number
description

The size of the entire collection

Methods

append

map

  • description

    Apply a transformation function to each element in the SelectList. The transformation function receives a Position based on its current location in the SelectList

    Type parameters

    • b

    Parameters

    • fn: function
        • (element: a, index?: number, position?: Position): b
        • Parameters

          • element: a
          • Optional index: number
          • Optional position: Position

          Returns b

    Returns SelectListImpl<b>

prepend

  • description

    Add elements to the beginning of the SelectList

    Parameters

    • arr: a[]

    Returns SelectListImpl<a>

select

  • description

    Shift the selected element to the first element which passes the provided predicate function. If no element is found, the SelectList will not be changed

    Parameters

    • predicateFn: function
        • (element: a): boolean
        • Parameters

          • element: a

          Returns boolean

    Returns SelectListImpl<a>

toArray

  • toArray(): a[]
  • description

    Returns the entire collection as a single array

    Returns a[]

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc