Skip to content

DanielJDufour/quick-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quick-promise

QuickPromise. Resolve Synchronously When Possible.

usage

import QuickPromise from "quick-promise";

QuickPromise.all

let resolved = false;
QuickPromise.all([1, 2]).then(nums => (resolved = true));
// resolved is true

let resolved = false;
QuickPromise.all([fetch(url), 9]).then([response, n]) => (resolved = true));
// resolved is false

QuickPromise.resolve

let resolved = false;
QuickPromise.resolve(1).then(num => (resolved = true));
// resolved is true

let resolved = false;
QuickPromise.resolve(fetch(url)).then(response => (resolved = true));
// resolved is false

let resolved = false;
await QuickPromise.resolve(fetch(url)).then(response => (resolved = true));
// resolved is true

About

QuickPromise. Resolve Synchronously When Possible.

Resources

License

Stars

Watchers

Forks

Packages

No packages published