Function extendStatus

  • Enriches a status object by appending request metadata, including its originating message ID and a resolved request state derived from the status contents.

    This serves as a post-processing step after a status has been extracted from a message.

    Returns

    An operator that transforms each emitted status into an augmented status object.

    Example

    source$.pipe(
    extendStatus({ statusKey: 'deviceInfo', messageId: 'req-123' })
    ).subscribe(status => {
    console.log(status.messageId);
    console.log(status.request); // e.g. "pending", "succeeded", "failed"
    });

    Type Parameters

    • T

      The status shape being extended.

    Parameters

    • data: {
          messageId: string;
          statusKey: keyof IStatus;
      }

      Context containing the originating message ID and the status key.

      • messageId: string
      • statusKey: keyof IStatus

    Returns UnaryFunction<Observable<T>, Observable<T & {
        messageId: string;
        request: RequestStatus;
    }>>

Generated using TypeDoc