Type Parameters

  • D = any

Implements

Constructors

Properties

data?: D
status: Status = Status.Ready
tokens: Token[] = []

Methods

  • It adds a token to the tokens array

    Parameters

    • token: Token

      The token to add to the list of tokens.

    Returns void

  • It returns a list of tokens that match the given identity

    Parameters

    Returns undefined | Token[]

    An array of tokens that match the identity.

  • If every token in the tokens array has a status of Completed, then return true

    Returns boolean

    A boolean value.

  • The function checks if the status is equal to "Failed".

    Returns boolean

    The isFailed() function is returning a boolean value

  • It returns true if some token in the tokens array has a status of Terminated

    Returns boolean

    A boolean value that is true if all the tokens have a status of Terminated.

  • It returns true if every token in the tokens array has a status of Paused

    Returns boolean

    A boolean value.

  • If the status property of the current instance is equal to the Ready constant, return true, otherwise return false.

    Returns boolean

    A boolean value.

  • It returns true if every token in the tokens array has a status of Terminated

    Returns boolean

    A boolean value that is true if all the tokens have a status of Terminated.

  • Return the next token's state if it's ready, otherwise return undefined.

    Returns undefined | State<any>

    The state of the first token that has a status of Ready.

  • If the status is running or paused, set the status to ready

    Parameters

    • force: boolean = false

    Returns Context<D>

    The instance of the class.

  • It returns an object with the data, status, and tokens.

    Parameters

    • options: {
          data: boolean;
          value: boolean;
      } = ...

      data: true, value: true

      • data: boolean
      • value: boolean

    Returns {
        data?: D;
        status: Status;
        tokens: {
            history: {
                name?: string;
                ref: string;
                status: Status;
                value?: any;
            }[];
            id: string;
            locked?: boolean;
            parent?: string;
        }[];
    }

    An object with the data, status, and tokens.

    • Optional data?: D
    • status: Status
    • tokens: {
          history: {
              name?: string;
              ref: string;
              status: Status;
              value?: any;
          }[];
          id: string;
          locked?: boolean;
          parent?: string;
      }[]
  • The function sets the status of an object to "Terminated".

    Returns Context<D>

    The terminate() method is returning the current object (this)

  • It returns a new instance of the Context class, with the data parameter passed in as the data property of the new instance

    Type Parameters

    • D = any

    Parameters

    Returns Context<D>

    A new instance of the Context class.

  • It takes a serialized context and returns a new context with the tokens deserialized

    Type Parameters

    • D = any

    Parameters

    Returns Context<D>

    A new Context object with the data passed in and the tokens mapped to Token objects.

Generated using TypeDoc