f07c79629e9a8134b7dacfe61b8f34cdc03031ab.svn-base
368 Bytes
'use strict'
class Async {
run (executors) {
const args = Array.from(arguments).slice(1)
return new Promise(resolve => resolve(executors.async.apply(null, args)))
}
all (arr) {
return Promise.all(arr)
}
returns (value) {
return Promise.resolve(value)
}
throws (reason) {
return Promise.reject(reason)
}
}
module.exports = Async