postponed-promise
v1.0.0
Published
Postponed promise - an elegant and simple way to use a promise
Downloads
1
Maintainers
Readme
Postponed promise
An elegant and simple way to use a promise
Installation & Usage
yarn add postponed-promise
import PostponedPomise from "postponed-promise"
export default function () {
let postponedPomise = new PostponedPomise()
doSomething()
.then(someParams => postponedPomise.resolve(someParams))
.catch(postponedPomise.reject)
return postponedPomise.promise
}