obstructed

1.0.5 • Public • Published

obstructed

npm version codecov

obstructed.js checks if the main thread is busy, executing a callback whenever it happens. It runs on the browser and on the server. The API is compatible with blocked.

Installation

npm install --save obstructed

Usage

const timer = obstructed(function(ms) {
  console.log('Main thread was blocked for about ' + ms + 'ms')
})

Use the returned timer and clearInterval on it to stop the lib on checking if the main thread is blocked.

// Uses the previously defined `timer`
clearInterval(timer)

Credits


caiogondim.com  ·  GitHub @caiogondim  ·  Twitter @caio_gondim

Readme

Keywords

none

Package Sidebar

Install

npm i obstructed

Weekly Downloads

32

Version

1.0.5

License

MIT

Unpacked Size

63.7 kB

Total Files

13

Last publish

Collaborators

  • caiogondim