Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jplhomer committed May 21, 2024
2 parents 915bd5c + 558f5f4 commit fb876fd
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/superflare/src/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ export abstract class Job {
/**
* Dispatch the job with the given arguments.
*/
static async dispatch<T extends Job>(
this: new (...arg: any[]) => T,
...args: any[]
) {
const job = new this(...args);
return job.dispatch(...args);
}
static async dispatch<T extends Job, Args extends any[]>(
this: new (...args: Args) => T,
...args: Args
) {
const job = new this(...args);

return job.dispatch(...args);
}

/**
* Convert the constructor arguments to a payload that can be sent to the queue.
Expand Down

0 comments on commit fb876fd

Please sign in to comment.