Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sp-analytics-tracker

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sp-analytics-tracker

Tracker fo sp analytics

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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(); 		
// { hello: '123', world: 123 } item still in the queue

queue.dequeue(); 	
// { hello: '123', world: 123 } item deleted from queue

queue.dequeue(); 	
// { hello: '456', world: 456 } item deleted from queue

queue.dequeue(); 	
// null	 queue is empty

FAQs

Package last updated on 11 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc