Skip to content

Commit 6d4c0fc

Browse files
committed
revert: convert revalidator and timeout iteration for improved clarity
1 parent 7303a80 commit 6d4c0fc

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/revalidator-manager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ export function revalidateAll(
8888
const flagIndex = type === 'focus' ? 5 : 6;
8989
const now = timeNow();
9090

91-
for (const entry of revalidators.values()) {
91+
revalidators.forEach((entry) => {
9292
if (!entry[flagIndex]) {
93-
continue;
93+
return;
9494
}
9595

9696
entry[1] = now;
@@ -101,7 +101,7 @@ export function revalidateAll(
101101
if (revalidator) {
102102
Promise.resolve(revalidator(isStaleRevalidation)).catch(noop);
103103
}
104-
}
104+
});
105105
}
106106

107107
/**

src/timeout-wheel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ export const removeTimeout = (key: string): void => {
119119

120120
export const clearAllTimeouts = () => {
121121
// Clear native setTimeout timeouts first!
122-
for (const value of keyMap.values()) {
122+
keyMap.forEach((value) => {
123123
if (Array.isArray(value)) {
124124
clearTimeout(value[0]);
125125
}
126-
}
126+
});
127127

128128
if (timer) {
129129
clearInterval(timer);

0 commit comments

Comments
 (0)