deasync-promise
v1.0.1
Published
Transform async functions into sync with promise API
Downloads
106,885
Readme
deasync-promise
Transforms async functions into sync with promise API
Usage
import deasyncPromise from 'deasync-promise';
let promiseWhichWillBeResolved = generateSuccessPromise();
let syncResult = deasyncPromise(promiseWhichWillBeResolved)
let promiseWhichWillBeRejected = generateRejectedPromise();
try {
let syncResult = deasyncPromise(promiseWhichWillBeRejected)
} catch (err) {
}