Class Create

Constructors

Methods

  • Creates a result that will be successful and contain the return value of fn as data, or otherwise be failed if fn throws.

    Type Parameters

    • S

    Parameters

    • fn: NullaryFn<S>

    Returns Box<S, Error>

  • Returns an Observable of result, that will be successful as long as the original observable doesn't error, and failed otherwise.

    Type Parameters

    • S

    Parameters

    • Constructor: LikeConstructor

      an ES Observable constructor

    • observable: Like<S>

      an ES Observable

    • OptionalcompleteOnFail: boolean

      whether the resulting observable should complete after a failed result

    Returns Like<Box<S, Error>>

  • Returns a Promise of a result, that will be successful if promise resolves, and failed otherwise.

    Type Parameters

    • S

    Parameters

    • promise: MaybePromiseLike<S> | NullaryFn<MaybePromiseLike<S>>

      a promise or a promise returning function

    Returns Promise<Box<S, Error>>