I think what would be really nice to have is, instead of Promsie.map, Array.prototype.amap/Array.prototype.afilter and Array.prototype.areduce. They all return a promise. This would be really handy.
Promsie.map
Array.prototype.amap
Array.prototype.afilter
Array.prototype.areduce
studentDetails .amap(getPerformanceRecordOfStudent) .then(doSomethingWithPerformanceRecordsOfAllStudents)
This is essentially the same thing, but I think it is more intuitive to use.
What do you think about this idea?
That would be interesting.
But adding something to native JS API, thats a lot to hope for :)
There are lots of other Promise utilities which will offer us handy utilities like this out of the box.
BTW, based on your comment, you would be super interested in the new async iteration proposal
Kushan also gives a small example in his comment.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think what would be really nice to have is, instead of
Promsie.map,Array.prototype.amap/Array.prototype.afilterandArray.prototype.areduce. They all return a promise. This would be really handy.This is essentially the same thing, but I think it is more intuitive to use.
What do you think about this idea?
That would be interesting.
But adding something to native JS API, thats a lot to hope for :)
There are lots of other Promise utilities which will offer us handy utilities like this out of the box.
BTW, based on your comment, you would be super interested in the new async iteration proposal
Kushan also gives a small example in his comment.