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

call-once-in-interval

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

call-once-in-interval

Calls the passed function once in the passed interval.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
259
decreased by-34.26%
Maintainers
1
Weekly downloads
 
Created
Source

call-once-in-interval

A JavaScript module which calls the passed function once in the passed interval.

NPM URL

  • @param {Function} functionTobeCalled The function to be called in the interval.
  • @param {number} [interval=600] The interval (in milliseconds) within which the function will not be called.
  • @returns {Function} Returns the new function.
  • @example
// Call a form submit only once even if the user presses the button multiple times.

const onSubmit = () => 'called'
const clickHandler = callOnceInInterval(onSubmit, 1000);

clickHandler();
// => 'called' //This will call the onSubmit

clickHandler();
// => undefined  //All the further calls will not be processed until 1000 ms.

Keywords

FAQs

Package last updated on 26 Apr 2017

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