0.1.1 • Published 3 years ago

localstorage-queue v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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();