Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "core/useChannel"

Index

Variables

Functions

Variables

Const NO_CHANNEL_NAME_WARNING

NO_CHANNEL_NAME_WARNING: "No channel name passed to useChannel. No channel has been subscribed to." = "No channel name passed to useChannel. No channel has been subscribed to."

Subscribe to a channel

param

The name of the channel you want to subscribe to.

typeparam

of channel you're subscribing to. Can be one of Channel or PresenceChannel from pusher-js.

returns

Instance of the channel you just subscribed to.

example
const channel = useChannel("my-channel")
channel.bind('some-event', () => {})

Functions

useChannel

  • useChannel<T>(channelName: string | undefined): undefined | T
  • Type parameters

    • T: Channel & PresenceChannel

    Parameters

    • channelName: string | undefined

    Returns undefined | T

Generated using TypeDoc