-
-
Notifications
You must be signed in to change notification settings - Fork 198
Closed as not planned
Labels
Description
This will allow us to extend the existing priority queue to make methods that change to the underlying structure for example "remove" to remove entries from the promise queue for scenarios like an image component getting unmounted so there's no point in keeping the promise of downloading the image.
Right now I am copying the class and adding the new method
removeWithPredicate(predicate: (entry: PriorityQueueOptions & { run: RunFunction }) => boolean): void {
let i, j;
for (i = 0, j = 0; i < this._queue.length; ++i) {
if (predicate(this._queue[i])) {
this._queue[j] = this._queue[i];
++j;
}
}
while (j < this._queue.length) {
this._queue.pop();
}
}
noisy