Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CommandContext<T>

Container for all the data need to execute a pending action, and yield a result or error at a later time.

Type parameters

  • T

Hierarchy

  • CommandContext

Implements

  • CommandContextLike<T>

Index

Constructors

constructor

Properties

Readonly action

action: CommandAction<T>

Readonly config

config: CommandConfig<T>

Optional error

error: any

Optional hasError

hasError: boolean

Optional result

result: T

Methods

run

  • Stands up an observable that will execute this command's action, and save the result (or error) to be unwrapped later.

    Emits immediately with the seed value when mocked is set to true.

    Returns Promise<CommandContext<T>>

setError

setResult

unwrap

  • unwrap(): Promise<T>
  • Unboxes the current state of this command as either an emission of the run result, or an exception stream for any caught errors.

    Returns Promise<T>

Generated using TypeDoc