mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-20 11:57:02 -04:00
qol improvements
This commit is contained in:
parent
c20dc269d2
commit
2c3dee4120
3 changed files with 159 additions and 50 deletions
|
@ -19,9 +19,9 @@
|
|||
import { Promisable } from "type-fest";
|
||||
|
||||
export class Queue {
|
||||
private promise = Promise.resolve();
|
||||
private promise: Promise<any> = Promise.resolve();
|
||||
|
||||
add(func: () => Promisable<void>) {
|
||||
this.promise = this.promise.then(func);
|
||||
add<T>(func: (lastValue: unknown) => Promisable<T>): Promise<T> {
|
||||
return (this.promise = this.promise.then(func));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue