Storage queue
This package contains a persistant FIFO queue implementation working with localstorage. It can enqueue and dequeue items, as well as peek the next item without deleting it.
Usage
import { LocalStorageQueue } from './src/local-storage-queue';
interface Message {
hello: string;
world: number;
}
const queue = new LocalStorageQueue<Message>('myQueue');
queue.initialize();
queue.enqueue({
hello: '123',
world: 123
});
queue.enqueue({
hello: '456',
world: 456
});
queue.peek();
queue.dequeue();
queue.dequeue();
queue.dequeue();