Sanity Library Reference Docs
    Preparing search index...

    Interface MessageBusEmitResult<R>

    A lazily awaited event reply.

    interface MessageBusEmitResult<R> {
        catch<T = never>(
            onRejected?: (reason: unknown) => T | PromiseLike<T>,
        ): Promise<R | T>;
        finally(onFinally?: () => void): Promise<R>;
    }

    Type Parameters

    • R

    Hierarchy

    • PromiseLike<R>
      • MessageBusEmitResult
    Index

    Methods

    Methods

    • Handles a rejected event reply.

      Type Parameters

      • T = never

      Parameters

      • OptionalonRejected: (reason: unknown) => T | PromiseLike<T>

      Returns Promise<R | T>

    • Runs after the event reply settles.

      Parameters

      • OptionalonFinally: () => void

      Returns Promise<R>