- task<Return, Args, LocalTask>(context: object, task: LocalTask, thunk?: (() => Args)): TaskInstance<Return>
-
Type Parameters
-
Return = unknown
-
Args extends unknown[] = unknown[]
-
LocalTask extends TaskIsh<Args, Return, LocalTask> = TaskIsh<Args, Return>
Parameters
-
context: object
-
task: LocalTask
-
Optional thunk: (() => Args)
Returns TaskInstance<Return>
Utility
uses Resource to make ember-concurrency tasks reactive.
Note
ember-resourcesdoes not provide or depend on ember-concurrency. If you want to use task, you'll need to add ember-concurrency as a dependency in your project.Example
When
this.idchanges, the task will automatically be re-invoked.(and all other properties on a TaskInstance)