Socket
Socket
Sign inDemoInstall

fun-dispatcher

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fun-dispatcher

Tiny ES6 class to run functions after a given delay. Uses just on timer at any time and setImmediate to launch


Version published
Weekly downloads
180
decreased by-15.89%
Maintainers
1
Install size
6.76 kB
Created
Weekly downloads
 

Readme

Source

codecov

fun-dispatcher

Tiny ES6 class to run functions after a given delay. Uses just on timer at any time and setImmediate to execute functions.

Written in Typescript, 100% test coverage, targeting current LTS Node.JS

Example:

const { Scheduler } = require('fun-dispatcher');

const fd = new Scheduler();

fd.schedule('task1', () => { console.log('Will run after about 600ms') }, 600);
fd.schedule('task2', () => {
    console.log('Tasks can be cancelled by id');
    fd.delete('task1')
}, 400)

// can forcefully execute all tasks
fd.flush();

Keywords

FAQs

Last updated on 23 Aug 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc