Skip to content
setInterval + requestIdleCallback function
TypeScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.netlify
public
src
test
.gitignore
.travis.yml
LICENSE
README.md
netlify.toml
package.json
tsconfig.json
yarn.lock

README.md

requestidleinterval Build Status

setInterval + requestIdleCallback function

Install

Install with npm:

npm install requestidleinterval

Usage

Example: Do task per 1000ms

import { requestIdleInterval } from "requestidleinterval";
const cancel = requestIdleInterval(() => {
    // Do interval task
}, {
        // interval msec
        interval: 1000,
        // if the enviroment is busy, the delay msec to do interval task
        timeout: 500
});

// if you want to cancel interval task
cancel(); 

Changelog

See Releases page.

Running tests

Install devDependencies and Run npm test:

npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu

You can’t perform that action at this time.