Returns an immutable queue. Queues are useful if you want to treat 'older' or 'newer'
items differently. Enqueing adds items at the back of the queue, while
dequeing removes items from the front (ie. the oldest).
import { Queues } from"https://unpkg.com/ixfx/dist/collections.js" letq = Queues.immutable(); // Create q = q.enqueue(`a`, `b`); // Add two strings constfront = q.peek(); // `a` is at the front of queue (oldest) q = q.dequeue(); // q now just consists of `b`
Example: Cap size to 5 items, throwing away newest items already in queue.
Returns an immutable queue. Queues are useful if you want to treat 'older' or 'newer' items differently. Enqueing adds items at the back of the queue, while dequeing removes items from the front (ie. the oldest).
Example: Cap size to 5 items, throwing away newest items already in queue.