Skip to content

Commit

Permalink
✏️ improve JSDoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
astoilkov committed Nov 20, 2023
1 parent b20053d commit fc0847a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type Task = {

/**
* Adds a task to the queue and returns the new task.
* @param priority {('background' | 'user-visible')} The priority of the new task.
* @param priority {SchedulingPriority} The priority of the new task.
*/
export function createTask(priority: SchedulingPriority): Task {
const item = { priority, deferred: new Deferred() }
Expand Down
4 changes: 2 additions & 2 deletions src/yieldControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import state from './state'
import queueTask from './queueTask'
import isTimeToYield from './isTimeToYield'
import hasValidContext from './hasValidContext'
import SchedulingPriority from './SchedulingPriority'
import { createTask, nextTask, removeTask } from './tasks'
import { cancelPromiseEscape, requestPromiseEscape } from './promiseEscape'
import SchedulingPriority from './SchedulingPriority'

let promiseEscapeId: number | undefined

Expand All @@ -13,7 +13,7 @@ let promiseEscapeId: number | undefined
* multiple times will create a LIFO(last in, first out) queue – the last call to
* `yieldControl()` will get resolved first.
*
* @param priority {('user-visible' | 'background')} The priority of the task being run.
* @param priority {SchedulingPriority} The priority of the task being run.
* `user-visible` priority will always be resolved first. `background` priority will always be
* resolved second.
* @returns {Promise<void>} The promise that will be resolved when the queue
Expand Down

0 comments on commit fc0847a

Please sign in to comment.