Observes communication with the server.

interface CommunicationObserver<T> {
    responseStarted?: ResponseStartedFn;
    useCancellable?: (cancellable: Cancellable) => void;
    useResume?: (resume: () => void) => void;
    complete(): void;
    error(error: Error): void;
    next(data: T): boolean | void;
}

Type Parameters

  • T

Properties

responseStarted?: ResponseStartedFn

Informs about a start of response processing.

useCancellable?: (cancellable: Cancellable) => void

Setups cancelllable for this communication.

useResume?: (resume: () => void) => void

Setups a callback that resumes reading of next data, it is called whenever CommunicationObserver.next returns false.

Type declaration

    • (resume: () => void): void
    • Parameters

      • resume: () => void

        a function that will resume reading of next data when called

      Returns void

Methods