Skip to content

Commit

Permalink
fix(types): better ember-concurrency@v1 support in typescript
Browse files Browse the repository at this point in the history
Issue: #297

Resolves this issue:
```
Argument of type 'TaskForAsyncTaskFunction<() => Promise<Food>>'
  is not assignable to parameter of type 'TaskIsh<Food, Data[]>'.

  The types returned by 'perform(...).cancel(...)' are incompatible between these types.
    Type 'void' is not assignable to type 'Promise<void>'.
```
  • Loading branch information
NullVoxPopuli committed Dec 5, 2021
1 parent 584e47a commit 91c8b20
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ jobs:
- run: |
cd ember-resources
yarn build:types
cd ../testing/ember-concurrency-v1-tests/
cd ../testing/ember-concurrency-v1/
tsc --build
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface TaskInstance<Return = unknown> extends Promise<Return> {
readonly isFinished: boolean;
readonly isRunning: boolean;
readonly isDropped: boolean;
cancel(reason?: string): Promise<void>;
cancel(reason?: string): void | Promise<void>;
}

// @private
Expand Down

0 comments on commit 91c8b20

Please sign in to comment.