isEnqueued
Return if a task is in the queue.
queue.isEnqueued(fn)
Returns boolean
true/false if the task fn
is in the queue.
Sometimes, it's necessary for a task to be immediately invoked. For example, an observation might depend on another observation currently in the queue. If this happens, the queued task can be run immediately.
const task = function task() {
console.log( "taskA" );
};
priorityQueue.enqueue( task, null, [], { priority: 5 } );
priorityQueue.isEnqueued( task ); //-> true
Parameters
- fn
{function}
:The function to to test if it is in the queue.
Returns
{Boolean}
:
Return true
or false
if the task fn
is in the queue.