A simple stack structure with notifications to the stack elements as to when they are added, removed, etc. The top-most element is considered "selected", and this stack also fires events as elements are selected and deselected.

Type Parameters

Hierarchy

  • MxtStack

Constructors

Properties

_data: T[]
_onAddedCallback: ((element: IStackable) => void)

Type declaration

_onDeselectedCallback: ((element: IStackable) => void)

Type declaration

_onRemovedCallback: ((element: IStackable) => void)

Type declaration

_onSelectedCallback: ((element: IStackable) => void)

Type declaration

Accessors

Methods

  • Brief

    Pops the top-most element from the stack, if one exists. Before being popped, the element is notified that it is deselected, then removed. The next element in line (if there is one) is then notified that it is selected.

    Returns

    The popped element, if one was available. Otherwise null.

    Returns T

  • Brief

    Pushes a new element onto the stack. If there is a current top element, it is deselected. The new element is then added (with callback) and selected.

    Parameters

    • element: T

      The element to be pushed.

    Returns void

Generated using TypeDoc