Skip to content

Commit d9e85b6

Browse files
committed
fix(readme): useTask is no longer coming soon -- it's here
1 parent 21c50e0 commit d9e85b6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ This is the same shape of args used throughout Ember's Helpers, Modifiers, etc
7272

7373
### `useTask`
7474

75-
_Coming soon_
76-
7775
This is a utility wrapper like `useResource`, but can be passed an ember-concurrency task
7876
so that the ember-concurrency task can reactively be re-called whenever args change.
7977
This largely eliminates the need to start concurrency tasks from the constructor, modifiers,
@@ -84,13 +82,16 @@ when it needs to.
8482

8583
```ts
8684
class MyClass {
87-
myData = useTask(this, this.myTask, () => [args, to, task])
85+
myData = useTask(this, this._myTask, () => [args, to, task])
8886

8987
@task
90-
*myTask(args, to, task) { /* ... */ }
88+
*_myTask(args, to, task) { /* ... */ }
9189
}
9290
```
9391

92+
Accessing `myData` will represent the last `TaskInstance`, so all the expected properties are available:
93+
`value`, `isRunning`, `isFinished`, etc
94+
9495
### Making your own Resources with
9596

9697
#### `LifecycleResource`

0 commit comments

Comments
 (0)