Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "core/useTrigger"

Index

Variables

Functions

Variables

Const NO_AUTH_HEADERS_WARNING

NO_AUTH_HEADERS_WARNING: "No auth parameters supplied to <PusherProvider />. Your events will be unauthenticated." = "No auth parameters supplied to <PusherProvider />. Your events will be unauthenticated."

Functions

useTrigger

  • useTrigger<TData>(channelName: string): (Anonymous function)
  • Hook to provide a trigger function that calls the server defined in PusherProviderProps.triggerEndpoint using fetch. Any auth?.headers in the config object will be passed with the fetch call.

    example
    const trigger = useTrigger<{message: string}>('my-channel');
    trigger('my-event', {message: 'hello'});

    Type parameters

    • TData

      shape of the data you're sending with the event

    Parameters

    • channelName: string

      name of channel to call trigger on

    Returns (Anonymous function)

Generated using TypeDoc