From 4d6cc62f0c9bb5d50720c83fb1ecbd0889d2acd3 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Wed, 23 Apr 2025 22:02:42 -0400 Subject: Naming improvements c/o Kit --- ui/lib/retry.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ui/lib/retry.js') diff --git a/ui/lib/retry.js b/ui/lib/retry.js index 777f1be..a2cff65 100644 --- a/ui/lib/retry.js +++ b/ui/lib/retry.js @@ -1,9 +1,9 @@ -export async function retry(callback, retryCond, delay) { +export async function retry(callback, shouldRetry, delay) { while (true) { try { return await callback(); } catch (err) { - if (retryCond(err)) { + if (shouldRetry(err)) { await delay(); } else { throw err; @@ -12,7 +12,7 @@ export async function retry(callback, retryCond, delay) { } } -export function delay(millis) { +export function timedDelay(millis) { return async () => await sleep(millis); } -- cgit v1.2.3