Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Push

Index

Constructors

constructor

  • Initializes the Push

    Parameters

    • channel: RealtimeSubscription

      The Channel

    • event: string

      The event, for example "phx_join"

    • Default value payload: {} = {}

      The payload, for example {user_id: 123}

      • [key: string]: unknown
    • Default value timeout: number = DEFAULT_TIMEOUT

      The push timeout in milliseconds

    Returns Push

Properties

channel

The Channel

event

event: string

The event, for example "phx_join"

payload

payload: {}

The payload, for example {user_id: 123}

Type declaration

  • [key: string]: unknown

recHooks

recHooks: { callback: Function; status: string }[] = []

receivedResp

receivedResp: { response: Function; status: string } | null = null

ref

ref: string = ""

refEvent

refEvent: string | null = null

sent

sent: boolean = false

timeout

timeout: number

The push timeout in milliseconds

timeoutTimer

timeoutTimer: number | undefined = undefined

Methods

Private _cancelRefEvent

  • _cancelRefEvent(): void

Private _cancelTimeout

  • _cancelTimeout(): void

Private _hasReceived

  • _hasReceived(status: string): null | false | true
  • Parameters

    • status: string

    Returns null | false | true

Private _matchReceive

  • _matchReceive(__namedParameters: { response: Function; status: string }): void
  • Parameters

    • __namedParameters: { response: Function; status: string }
      • response: Function
      • status: string

    Returns void

destroy

  • destroy(): void

receive

  • receive(status: string, callback: Function): this
  • Parameters

    • status: string
    • callback: Function

    Returns this

resend

  • resend(timeout: number): void

send

  • send(): void

startTimeout

  • startTimeout(): void

trigger

  • trigger(status: string, response: any): void
  • Parameters

    • status: string
    • response: any

    Returns void

updatePayload

  • updatePayload(payload: {}): void
  • Parameters

    • payload: {}
      • [key: string]: unknown

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Private method

Generated using TypeDoc