Socket
Book a DemoInstallSign in
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
npmnpm
Version published
Weekly downloads
7
-41.67%
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

javascript

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.