Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • RealtimeSubscription

Index

Constructors

constructor

Properties

bindings

bindings: any[] = []

joinPush

joinPush: Push

joinedOnce

joinedOnce: boolean = false

params

params: {}

Type declaration

  • [key: string]: unknown

pushBuffer

pushBuffer: Push[] = []

rejoinTimer

rejoinTimer: Timer

socket

state

state: CHANNEL_STATES = CHANNEL_STATES.closed

timeout

timeout: number

topic

topic: string

Methods

canPush

  • canPush(): boolean

isClosed

  • isClosed(): boolean

isErrored

  • isErrored(): boolean

isJoined

  • isJoined(): boolean

isJoining

  • isJoining(): boolean

isLeaving

  • isLeaving(): boolean

isMember

  • isMember(topic: string): boolean

joinRef

  • joinRef(): string

off

  • off(event: string): void

on

  • on(event: string, callback: Function): void

onClose

  • onClose(callback: Function): void

onError

  • onError(callback: Function): void

onMessage

  • onMessage(event: string, payload: any, ref?: undefined | string): any
  • Overridable message hook

    Receives all events for specialized message handling before dispatching to the channel callbacks. Must return the payload, modified or unmodified.

    Parameters

    • event: string
    • payload: any
    • Optional ref: undefined | string

    Returns any

push

rejoin

  • rejoin(timeout?: number): void

rejoinUntilConnected

  • rejoinUntilConnected(): void

replyEventName

  • replyEventName(ref: string): string

subscribe

  • subscribe(timeout?: number): Push

trigger

  • trigger(event: string, payload?: any, ref?: undefined | string): void

unsubscribe

  • unsubscribe(timeout?: number): Push
  • Leaves the channel

    Unsubscribes from server events, and instructs channel to terminate on server. Triggers onClose() hooks.

    To receive leave acknowledgements, use the a receive hook to bind to the server ack, ie: channel.unsubscribe().receive("ok", () => alert("left!") )

    Parameters

    • Default value timeout: number = this.timeout

    Returns Push

updateJoinPayload

  • updateJoinPayload(payload: {}): void

Legend

  • Constructor
  • Property
  • Method
  • Private method

Generated using TypeDoc