Options
All
  • Public
  • Public/Protected
  • All
Menu

Event based communication module

Hierarchy

  • PubSubClass

Implements

Index

Constructors

  • The constructor function of PubSub

    Returns PubSubClass

Properties

name: string = "PubSub"

Used as class' identity. will have constant value of "Permission"

Accessors

  • get subscriptions(): Record<string, any>
  • getter for property subscriptions

    Returns Record<string, any>

Methods

  • configure<config>(arg: config): void
  • Add configuration into options property

    Type Parameters

    • config

    Parameters

    • arg: config

    Returns void

  • publish(type: string, message: any): void
  • Funtion to publish custom event

    Parameters

    • type: string
    • message: any

    Returns void

  • subscribe(type: string, listener: ((e: CustomEvent<any>) => any), options?: EventListenerOptions): string
  • Function to subscribe to custom event

    Parameters

    • type: string
    • listener: ((e: CustomEvent<any>) => any)
        • (e: CustomEvent<any>): any
        • Parameters

          • e: CustomEvent<any>

          Returns any

    • Optional options: EventListenerOptions

    Returns string

    subscription token string

  • unsubscribe(token: string): void
  • unsubscribe(type: string, listener: ((e: CustomEvent<any>) => any), options?: boolean | EventListenerOptions): void
  • Function to cancel a certain subscription

    Parameters

    • token: string

    Returns void

  • Function to cancel a certain subscription

    Parameters

    • type: string
    • listener: ((e: CustomEvent<any>) => any)
        • (e: CustomEvent<any>): any
        • Parameters

          • e: CustomEvent<any>

          Returns any

    • Optional options: boolean | EventListenerOptions

    Returns void

  • unsubscribeAll(): void
  • Function to cancel all subscription(s)

    Returns void

Generated using TypeDoc