collect-your-stuff
    Preparing search index...

    Class Stackable

    Stackable represents a runnable entry in stack.

    Implements

    Index
    • Create a stackable item that can be used in a stack.

      Parameters

      • stackData: { next?: Stackable; ready?: boolean; task?: any } = {}

        The settings for the new stackable.

        • Optionalnext?: Stackable

          The reference to the next stackable if any

        • Optionalready?: boolean

          Indicate if the stackable is ready to run

        • Optionaltask?: any

          The data to be stored in this stackable

      Returns Stackable

    classType: typeof Stackable

    The class used to create this instance, so that it can be recognized as valid without an instanceof check.

    data: any = null

    The task (or data) this stackable holds.

    next: Stackable = null

    The stackable below this one, or null when this is the bottom.

    • Convert an array into Stackable instances, return the head and tail Stackables.

      Parameters

      • values: any[] = []

        Provide an array of data that will be converted to a chain of stackable linkers.

      • classType: any = Stackable

        Provide the type of IsLinker to use.

      Returns { head: IsLinker; tail: IsLinker }

    • Make a new Stackable from the data given if it is not already a valid Stackable.

      Parameters

      • stackable: any

        Return a valid Stackable instance from given data, or even an already valid one.

      • classType: any = Stackable

        Provide the type of IsLinker to use.

      Returns Stackable