Class ShimiHandler<TData, TSource>

The ShimiHandler is designed to be added to ShimiEvents, containing some action to be called whenever the event is triggered.

Type Parameters

Hierarchy

  • ShimiHandler

Constructors

Accessors

Methods

Constructors

  • Type Parameters

    Type Parameters

    Parameters

    • logic: ((data: TData) => void)

      The logic to be executed whenever the event that the handler is attached to gets triggered.

        • (data: TData): void
        • Parameters

          • data: TData

          Returns void

    • Optional ref: string

      Provides a way of identifying handlers so they can be easily retrieved later.

    Returns ShimiHandler<TData, TSource>

Accessors

  • get logic(): ((data: TData) => void)
  • The logic to be executed whenever the event that the handler is attached to gets triggered.

    Returns ((data: TData) => void)

      • (data: TData): void
      • The logic to be executed whenever the event that the handler is attached to gets triggered.

        Parameters

        • data: TData

        Returns void

  • get on(): boolean
  • If false, then the handler should be skipped.

    Returns boolean

  • set on(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get ref(): string
  • Provides a way of identifying handlers so they can be easily retrieved later.

    Returns string

  • set ref(value: string): void
  • Parameters

    • value: string

    Returns void

Methods

  • Provides a way for setting the ref through a chained function call. For example:

    keyboard.a.pressed.add(data => console.log(data)).withRef('key log');
    

    Returns

    The calling object.

    Parameters

    • ref: string

      The ref to set on the object.

    Returns ShimiHandler<TData, TSource>

Generated using TypeDoc