1.0.5 • Published 6 years ago

obstructed v1.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

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

1.0.5

6 years ago

1.0.4

8 years ago

1.0.2

8 years ago