• Utility to create a promise that can be resolved by publishing an event

    Type Parameters

    • TRequest = any
    • TResponse = ApiCallback<string>

    Parameters

    • requestEvent: string

      Event type to publish the request

    • responseEvent: string

      Event type to wait for the response

    • request: TRequest

      The request data to publish

    • Optional timeout: number

      Optional timeout in milliseconds

    Returns Promise<TResponse>

    Promise that resolves with the response