Comments (1)
resolve() can return only single value. To resolve this we could return array when there is multiple parameters.
fun().then(([r1, r2, r3]) => {
// r1 => 'res1'
// r2 => 'res2'
// r3 => 'res3'
});
That would break code if there is inconsistent callback that sometimes returns one parameter and other time multiple parameter.
For consistency we should always return single parameter or array of parameters. We can default to single parameter as that is most common scenario. we can allow additional options that will dictate array of parameters to be always returned (even if single parameter)
promisify(cbFun, { multiArgs: true })
from js-flock.
Related Issues (14)
- Require single module without need to specify 'src' folder path
- deepFreeze don't freeze non enumerable props HOT 7
- deepFreeze doesn't freeze Symbol props HOT 1
- deepFreeze raises error on Buffer fields HOT 4
- deepFreeze skips child's of frozen objects HOT 1
- Document sort function stability HOT 3
- Promisify.all duplicate promisified functions on each call
- Browser support question / Reflect usage HOT 2
- I would like a syntax for sorting some properties ascending and others descending HOT 8
- Working incorrectly with character and number HOT 2
- Add timsort to benchmark HOT 2
- created by mistake
- Publish typescript types? 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 js-flock.