From 5e33bfd169f95735b7aedbf5615d54759c03049c Mon Sep 17 00:00:00 2001 From: Antonio Stoilkov Date: Mon, 18 Mar 2024 11:47:07 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9C=20rename=20parameter=20name=20`pri?= =?UTF-8?q?ority`=20=E2=86=92=20`strategy`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/yieldOrContinue.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/yieldOrContinue.ts b/src/yieldOrContinue.ts index 80ad911..3d28f34 100644 --- a/src/yieldOrContinue.ts +++ b/src/yieldOrContinue.ts @@ -8,7 +8,7 @@ import SchedulingStrategy from './SchedulingStrategy' * `yieldOrContinue()` multiple times will create a LIFO(last in, first out) queue – the last call * to `yieldOrContinue()` will get resolved first. * - * @param priority {SchedulingStrategy} The priority of the task being run. + * @param strategy {SchedulingStrategy} The priority of the task being run. * `smooth` priority will always be resolved first. `background` priority will always be * resolved second. * @returns {Promise} A promise either immediately resolved or when the browser is ready to @@ -17,11 +17,11 @@ import SchedulingStrategy from './SchedulingStrategy' // disabling ESLint otherwise `requestPromiseEscape()` in `yieldControl()` won't work // eslint-disable-next-line @typescript-eslint/promise-function-async export default function yieldOrContinue( - priority: SchedulingStrategy = 'smooth', + strategy: SchedulingStrategy = 'smooth', signal?: AbortSignal, ): Promise { - if (signal?.aborted !== true && isTimeToYield(priority)) { - return yieldControl(priority, signal) + if (signal?.aborted !== true && isTimeToYield(strategy)) { + return yieldControl(strategy, signal) } return Promise.resolve()