New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

set-interval

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

set-interval

start and clear interval without setting a variable

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
597
increased by19.16%
Maintainers
1
Weekly downloads
 
Created
Source

SetIntervalJS Twitter URL

MIT Licence npm version

SetIntervalJS is a constructor which hide inside reference to setInterval() for cleaner usage. It helps to make your code cleaner and there is no need to have more variables for clearInterval() 👌. SetIntervalJS has two methods start and clear. start method calls a function at specified intervals (in milliseconds) and clear clear the interval.

Getting SetIntervalJS

npm install set-interval or yarn add set-interval

Examples

Basic example

import SetInterval from 'set-interval'
Start interval
SetInterval.start(callback, 1000)
Clear interval
SetInterval.clear()

Multiple instances

const SetInerval_2 = Object.assign({}, SetInterval)
const SetInerval_3 = Object.assign({}, SetInterval)

SetInterval.start(callback, 1000)
SetInerval_2.start(callback_2, 1000)
SetInerval_3.start(callback_3, 1000)

SetInterval.clear()
SetInterval_2.clear()
SetInterval_3.clear()

Keywords

FAQs

Package last updated on 29 Nov 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