UniqueQueue

Monster.Types. UniqueQueue

You can call the method via the monster namespace new Monster.Types.Queue().

<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/monster.js';
new Monster.Types.UniqueQueue()
</script>

Alternatively, you can also integrate this function individually.

<script type="module">
import {UniqueQueue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.0/dist/modules/types/uniquequeue.js';
new UniqueQueue()
</script>

Constructor

# new UniqueQueue()

A queue for unique values

Since:
  • 1.4.0

Methods

# add(value) → {Queue}

Add a new element to the end of the queue.

Parameters:
Name Type Description
value object
Throws:

value is not a object

Type
TypeError
Returns:
Type
Queue

# clear() → {Queue}

remove all entries

Returns:
Type
Queue

# poll() → {object}

Remove the element at the front of the queue If the queue is empty, return undefined.

Returns:
Type
object