Skip to content

A better async function than the setTimeout(..., 0) for the browser

License

Notifications You must be signed in to change notification settings

knowledgecode/nowait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

npm install knowledgecode@nowait --save

Usage

ES modules:

import nowait from './dist/nowait.es.min.js';

nowait(fn);

Traditional:

<script src="./dist/nowait.min.js"></script>
<script>
  nowait(fn);
</script>

Browser support

Chrome, Android Chrome, Firefox, Safari, iOS Safari, Edge, IE

About

A better async function than the setTimeout(..., 0) for the browser

Resources

License

Stars

Watchers

Forks

Packages

No packages published