abortable-interval
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

abortable-interval

abortable interval via abort signals

Installation

npm i --save abortable-interval

Usage

Supports both ESM and CommonJS

// esm
import interval from 'abortable-interval'
// commonjs
const interval = require('abortable-interval').default

Example

import interval from 'abortable-interval'

const controller = new AbortController()
const signal = controller.signal

interval(1000, signal, () => {
  console.log('interval', Date.now())
})

controller.abort() // clears interval

License

MIT

Package Sidebar

Install

npm i abortable-interval

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

11.6 kB

Total Files

16

Last publish

Collaborators

  • tjmehta