Comments (2)
It's not something this library is able to do, but it should be trivial to implement yourself. Something like:
function promisified(...args) {
return new Promise((resolve, reject) => {
function cb(err, result) {
if (err) {
return reject(err);
}
resolve(result);
}
args.push({callback: cb});
func(...args);
});
}
NB: Haven't tested this code, just off the top of my head! :)
from es6-promisify.
Thanks a lot, Mike! Really appreciate your suggestions!
On Mon, Jul 25, 2016 at 2:12 AM, Mike Hall [email protected] wrote:
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#18 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACS8QtIpUAvbD_8DG0J9ybqx1wPIlEBeks5qZH4OgaJpZM4JSCQ1
.
Yu Wu
from es6-promisify.
Related Issues (20)
- Promises with multiple arguments group args into an array HOT 3
- Remove "own resolver" functionality HOT 1
- Document a callback with multiple arguments HOT 7
- Should detect attempts to promisify promises
- Minify bundle. HOT 2
- Allow promisifying methods (not just functions) HOT 10
- Bundling a promise polyfill is not optimal HOT 1
- Add `thisArg` option usage in readme documentation HOT 1
- Does not work on iOS9 safari HOT 1
- `multiArgs` doesn't work in case of rejection HOT 4
- Invalid assignment error.
- Please add LICENSE file HOT 1
- This library should not require es6-promise,may be I require another promise library. HOT 1
- is it possible to trigger HTTP requests from this plugin? HOT 1
- Latest version only returns first callback value if argumentNames is not set HOT 2
- Deploy on Azure failed
- Unable to promisify localStorage HOT 1
- Does this work with async and await? HOT 2
- Cannot read property 'apply' of undefined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from es6-promisify.