https://github.com/knowledgecode/nowait
A better async function than the setTimeout(..., 0) for the browser
https://github.com/knowledgecode/nowait
Last synced: 5 months ago
JSON representation
A better async function than the setTimeout(..., 0) for the browser
- Host: GitHub
- URL: https://github.com/knowledgecode/nowait
- Owner: knowledgecode
- License: mit
- Created: 2019-08-05T12:39:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-14T08:50:46.000Z (over 1 year ago)
- Last Synced: 2025-03-18T03:59:00.632Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nowait
This is a better async function than the `setTimeout(..., 0)` for the browser. It will execute the passed function asynchronously with the best way in supported by the running browser. The `setTimeout(..., 0)` will be used if there is no other better way.
## Installation
via npm:
```shell
npm install knowledgecode@nowait --save
```
## Usage
ES modules:
```javascript
import nowait from './dist/nowait.es.min.js';
nowait(fn);
```
Traditional:
```html
nowait(fn);
```
## Browser support
Chrome, Android Chrome, Firefox, Safari, iOS Safari, Edge, IE