Search e01
One query across the encyclopedia, books, dictionary, papers, Wikidata and the developer library. Every hit carries its source.
5 results across 6 corpora for TaskPriorityChangeEvent: TaskPriorityChangeEvent() constructor.
Developer library 5
Prioritized Task Scheduling API
hanging its priority. - TaskSignal - : A signal object that allows you to abort a task and change its priority, if required, using a TaskController object. - TaskPriorityChangeEvent - : The interface for the prioritychange event, which is sent when the priority for a task is changed. > [!NOTE] > If the [task priority](#task_priorities) never needs to be changed, you can use an AbortController and its associated
TaskPriorityChangeEvent
Prioritized Task Scheduling API The **`TaskPriorityChangeEvent`** is the interface for the [`prioritychange`](/docs/Web/API/TaskSignal/prioritychange_event) event. ## Constructor - TaskPriorityChangeEvent() - : Creates a new `TaskPriorityChangeEvent` object, setting an event name and previous priority. ## Instance properties _This interface also inherits the properties of its parent, Event._ - TaskPriorityC
TaskPriorityChangeEvent: TaskPriorityChangeEvent() constructor
Prioritized Task Scheduling API The **`TaskPriorityChangeEvent()`** constructor creates a new TaskPriorityChangeEvent object. This object is created with a value indicating the [previous priority](/docs/Web/API/Prioritized_Task_Scheduling_API#task_priorities) of the task: the priority before it changed and this event was fired. ## Syntax ```js-nolint new TaskPriorityChangeEvent(type, options) ``` ### Parameters
TaskPriorityChangeEvent: previousPriority property
Prioritized Task Scheduling API The **`previousPriority`** read-only property of the TaskPriorityChangeEvent interface returns the priority of the corresponding TaskSignal before it was changed and this [`prioritychange`](/docs/Web/API/TaskSignal/prioritychange_event) event was emitted. This is the value that was set in the [`TaskPriorityChangeEvent` constructor](/docs/Web/API/TaskPriorityChangeEvent/TaskPriorityCh
TaskController
(here `addEventListener()` is called, but we could instead assign a handler to `TaskSignal.onprioritychange`). The handler uses [previousPolicy](/docs/Web/API/TaskPriorityChangeEvent/previousPriority) on the event to get the original priority and TaskSignal.priority on the event target to get the new priority. ```js // Listen for 'prioritychange' events on the controller's signal. controller.signal.addEventListener