https://github.com/taylorhakes/setasap
setImmediate polyfill for the browser and node
https://github.com/taylorhakes/setasap
Last synced: 7 months ago
JSON representation
setImmediate polyfill for the browser and node
- Host: GitHub
- URL: https://github.com/taylorhakes/setasap
- Owner: taylorhakes
- License: mit
- Created: 2014-04-14T15:24:37.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T17:45:59.000Z (almost 3 years ago)
- Last Synced: 2025-03-12T08:44:50.793Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 743 KB
- Stars: 43
- Watchers: 4
- Forks: 4
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
setAsap [](https://travis-ci.org/taylorhakes/setAsap)
====setImmediate polyfill for the browser and node. This is an alternative to `setTimeout(fn, 0)`, which behaves like `setTimeout(fn, 4)`. setAsap will execute immediately. It has unmatched performance and is extremely lightweight.
### Install
```
npm install setasap --save
```### Use
```
setAsap(function() {
// do something async
});
```#### Note
Currently, there is no way to cancel setAsap. The code base is much smaller without it.