tsbase
    Preparing search index...

    Class AsyncObservable<T>

    Coordinates async subscriber actions with publish events

    Type Parameters

    • T

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    active: boolean = true
    CurrentIssue?: T
    subscribers: Map<string, (content?: T) => void> = ...

    Methods

    • A single issue subscription. Once the function for an order fires, it is automatically canceled

      Parameters

      • func: (content?: T) => Promise<void>
      • useCurrentIssue: boolean = true

        Determines if the order can be filled by the current issue

      Returns Promise<void>

    • Specify an async function to fire on future publish events | id returned allows caller to cancel subscription

      Parameters

      • func: (content?: T) => Promise<void>
      • useCurrentIssue: boolean = true

      Returns Promise<string>