This module provides a class to organize a simple Queue data structure. See core/queue for more information.
core/queue
import Queue from 'core/queue/simple';const queue = new Queue();queue.push(1);queue.push(5);queue.push(2);queue.push(-1);queue.push(5);queue.push(2);queue.push(-1);queue.push(5);console.log(queue.length); // 8console.log(queue.head); // 1console.log(queue.pop()); // 1console.log(queue.head); // 5console.log(queue.pop()); // 5console.log(queue.pop()); // 2console.log(queue.pop()); // -1console.log(queue.pop()); // 5console.log([...queue]); // [2, -1, 5]const clonedQueue = queue.clone();queue.clear();console.log(queue.length); // 0console.log(clonedQueue.length); // 3
core/queue/simple
This module provides a class to organize a simple Queue data structure. See
core/queue
for more information.