1.0.1 • Published 8 years ago

deasync-promise v1.0.1

Weekly downloads
159,632
License
ISC
Repository
github
Last release
8 years ago

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