Skip to content

Commit

Permalink
feat(task): added isTask static method
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewcourtice committed Feb 18, 2022
1 parent e49d77e commit 5a207ce
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/task/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ export default class Task<T = void> extends Promise<T> {
this.controller = controller;
}

public static isTask(value: unknown): value is Task {
return value instanceof Task;
}

public get signal(): AbortSignal {
return this.controller.signal;
}
Expand Down

0 comments on commit 5a207ce

Please sign in to comment.