Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ResultImpl<R>

Implementation if Result that resolves when an Emitter emits a value

If the Emitter emits an error event, the Result is rejected.

Type parameters

  • R

Hierarchy

  • ResultImpl

Implements

  • Promise<R>

Index

Constructors

constructor

  • Create a ResultImpl with an emitter.

    Parameters

    • emitter: Emitter

      the emitter that this Result will listen to

    Returns ResultImpl

Properties

[email protected]StringTag

[email protected]StringTag: "Promise"

Get the 'Promise' string tag

Private promise

promise: any

An internal promise

Methods

catch

  • catch<U>(rejected?: undefined | function): Promise<U>
  • Forward the call to the internal promise

    inheritdoc

    Type parameters

    • U

    Parameters

    • Optional rejected: undefined | function

    Returns Promise<U>

finally

  • finally<U>(onFinally?: undefined | function): Promise<U>
  • Forward the call to the internal promise

    inheritdoc

    Type parameters

    • U

    Parameters

    • Optional onFinally: undefined | function

    Returns Promise<U>

then

  • then<U, V>(fulfilled?: null | function, rejected?: null | Callback<V> | Callback<void> | PromiseLike<V>): Promise<U>
  • Forward the call to the internal promise

    inheritdoc

    Type parameters

    • U

    • V

    Parameters

    • Optional fulfilled: null | function
    • Optional rejected: null | Callback<V> | Callback<void> | PromiseLike<V>

    Returns Promise<U>