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

better-timeout

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-timeout

Standard javascript setTimeout with clearTimeout as returned function

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Standard javascript setTimeout with clearTimeout as returned function

Motivation

I was tired from saving of timeout ID and when I had more than 2 it was a mess. The timeout function is very simple and it is using standard setTimeout and clearTimeout at the background.

Example

import timeout from 'better-timeout';

const clear = timeout(() => {
  console.log('hello');
}, 5000);

clear();

It is safe to call clear function multiple times. It will call clearTimeout just once.

Keywords

FAQs

Package last updated on 23 Jun 2016

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