Package Exports
- quick-resolve
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (quick-resolve) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
quick-resolve
A Synchronous Promise.resolve. Preserve Sync/Async. Only Go Async If Necessary.
install
npm install quick-resolve
usage
import quickResolve from "quick-resolve";
let resolved = false;
quickResolve(1).then(num => (resolved = true));
// resolved is true
let resolved = false;
quickResolve(fetch(url)).then(response => (resolved = true));
// resolved is false
let resolved = false;
await quickResolve(fetch(url)).then(response => (resolved = true));
// resolved is true