tonyfromundefined / localstorage-queue

Queue(FIFO) implementation using LocalStorage API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LocalStorage Queue

Queue(FIFO) implementation using LocalStorage API

Install

$ yarn add localstorage-queue

Usage

import { LocalStorageQueue } from "localstorage-queue";

const queue = new LocalStorageQueue({
  key: "something",
});

// Issue an event
queue.emit("hello", { world: true });

// Register a listener
queue.on("hello", (data) => {
  console.log(data);
});

// listening...
queue.listen();

About

Queue(FIFO) implementation using LocalStorage API


Languages

Language:TypeScript 89.0%Language:JavaScript 11.0%