Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DiscreteAction

Class that represents a discrete action that can be in one of two states, started or stopped for each user. @see ActionState

Hierarchy

  • DiscreteAction

Index

Methods

Methods

getState

  • Gets the current state of the action for the user with the given id.

    Parameters

    • userId: string

      The id of the user to get the action state for.

    Returns ActionState

    The current state of the action for the user.

isActive

  • isActive(userId?: string): boolean
  • Get whether the action is active for the user with the given id.

    Parameters

    • Optional userId: string

      The id of the user to get whether the action is active for, or null if active for any user is desired..

    Returns boolean

    • True if the action is active for the user, false if it is not. In the case that no user is given, the value is true if the action is active for any user, and false if not.

on

  • Add a handler for the given action state for when it is triggered.

    Parameters

    • actionState: ActionState

      The action state that the handle should be assigned to.

    • handler: ActionHandler

      The handler to call when the action state is triggered.

    Returns this