Previous: Testing & Debugging
Next: FAQ & Fact Sheet
The documentation below covers how to use ember-concurrency v2.3+ with Ember Octane. For older versions of ember-concurrency (or pre-Octane Ember), please see the old guides.
ember-concurrency tasks play nicely with TypeScript and all of the APIs covered in these docs. Here is an example of a TypeScript component with an ember-concurrency task:
Task
objectsIn most cases, you don't need to provide type annotations for your task, but when you do (such as when specifying the Args of a Glimmer component), you can use the Task type:
Support for TypeScript in ember-concurrency was recently greatly improved and simplified
with the release of version 2.3, largely due to the introduction of the new
async arrow task function syntax (e.g. myTask = task(async () => {})
),
which alleviated most / all of the prior challenges with getting ember-concurrency tasks
to play nicely with TypeScript.
taskFor()
function it provides is no longer necessary
for interacting with tasks declared using the new syntax. See v2.3.0 and v2.3.2 release notes.
If you would like to see the TypeScript guides for older versions of ember-concurrency (or pre-Octane Ember), please see the old guides.
Previous: Testing & Debugging
Next: FAQ & Fact Sheet