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
signal
@switchyard-ts/ember
await settled()
@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.
cancelAll()
onError
Performs an ember-concurrency task from an
@invokemethod. Leaving the state, or stopping the machine, abortssignaland so cancels the task instance. With@switchyard-ts/emberimported,await settled()waits for it.A task cancelled some other way while the state is active (
cancelAll(), a restartable task performed again) rejects, so the machine takesonError.