Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "core/useEvent"

Index

Functions

Functions

useEvent

  • useEvent<D>(channel: Channel | PresenceChannel | undefined, eventName: string, callback: (data?: D) => void): void
  • Subscribes to a channel event and registers a callback.

    Type parameters

    • D

    Parameters

    • channel: Channel | PresenceChannel | undefined

      Pusher channel to bind to

    • eventName: string

      Name of event to bind to

    • callback: (data?: D) => void

      Callback to call on a new event

        • (data?: D): void
        • Parameters

          • Optional data: D

          Returns void

    Returns void

Generated using TypeDoc