Skip to content

Commit

Permalink
add suggestion to keep queued operation up-to-date
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Apr 24, 2024
1 parent 8d2bc98 commit 3402ec8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/core/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,12 @@ export const Client: new (opts: ClientOptions) => Client = function Client(
Promise.resolve().then(dispatchOperation);
} else if (active.has(operation.key)) {
let queued = false;
for (let i = 0; i < queue.length; i++)
queued = queued || queue[i].key === operation.key;
for (let i = 0; i < queue.length; i++) {
if (queue[i].key === operation.key) {
queue[i] = operation;
queued = true;
}
}

if (
!queued &&
Expand Down

0 comments on commit 3402ec8

Please sign in to comment.