switchyard
    Preparing search index...
    • Performs an ember-concurrency task from an @invoke method. Leaving the state, or stopping the machine, aborts signal and so cancels the task instance. With @switchyard-ts/ember imported, await settled() waits for it.

      @invoke(SearchState.Loading, { onDone: SearchState.Done, onError: SearchState.Failed })
      load(signal: AbortSignal) {
        return perform(signal, this.lookup, this.query)
      }
      

      A task cancelled some other way while the state is active (cancelAll(), a restartable task performed again) rejects, so the machine takes onError.

      Type Parameters

      • T
      • A extends unknown[]

      Parameters

      • signal: AbortSignal
      • task: Task<T, A>
      • ...args: A

      Returns Promise<T>