deasync-promise

Transform async functions into sync with promise API

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
deasync-promise
1.0.17 years ago7 years agoMinified + gzip package size for deasync-promise in KB

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) {
}