• A wrapper around makeSubscriptionPromise that helps to build multiple promises which listen to the same subscription.

    Returns

    An object containing both a subscription callback and an array of promises which resolve or reject depending on the values pushed to the callback.

    Type Parameters

    • SubscriptionType

    Parameters

    • args: TerminationOptions<SubscriptionType>[]

      An array of objects each of which provides the arguments for creation of one promise.

    Returns {
        promises: Promise<SubscriptionType>[];
        subscription: ((value: SubscriptionType) => void);
    }

    • promises: Promise<SubscriptionType>[]
    • subscription: ((value: SubscriptionType) => void)
        • (value: SubscriptionType): void
        • Parameters

          • value: SubscriptionType

          Returns void