Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TargetBehavior

Target behavior class containing the target behavior actions.

Hierarchy

Index

Accessors

behaviorType

Methods

_supportsAction

  • _supportsAction(actionName: string): boolean

isTargeted

  • isTargeted(user?: User): boolean
  • Gets whether the behavior is being targeted by the given user, or at all if no user is given.

    Parameters

    • Optional user: User

      The user to check whether they are targeting this behavior.

    Returns boolean

    True if the user is targeting this behavior, false if not. In the case where no user id is given, this returns true if any user is targeting this behavior, false if none are.

onTarget

  • Add a target handler to be called when the given target state is triggered.

    Parameters

    • targetState: "enter" | "exit"

      The target state to fire the handler on.

    • handler: ActionHandler<TargetEventData>

      The handler to call when the target state is triggered.

    Returns this

    This target behavior.