Skip to content

Commit

Permalink
🐜 rename parameter name priority β†’ strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
astoilkov committed Mar 18, 2024
1 parent 3f82d21 commit 5e33bfd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/yieldOrContinue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>} A promise either immediately resolved or when the browser is ready to
Expand All @@ -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<void> {
if (signal?.aborted !== true && isTimeToYield(priority)) {
return yieldControl(priority, signal)
if (signal?.aborted !== true && isTimeToYield(strategy)) {
return yieldControl(strategy, signal)
}

return Promise.resolve()
Expand Down

0 comments on commit 5e33bfd

Please sign in to comment.