petkaantonov / bluebird

:bird: :zap: Bluebird is a full featured promise library with unmatched performance.
http://bluebirdjs.com
MIT License
20.45k stars 2.34k forks source link

Feature: use ES6 proxy to support all methods on promised objects #1699

Open Tantalon opened 1 year ago

Tantalon commented 1 year ago

If we could chain async method calls on promised objects, we could eliminate intermediate awaits and just have a single await on the result: await Promise.resolve('hello').toUpperCase().replace(/$/, ', world!')

My proposal is to use ES6 Proxy so that any unknown method call is a promise to perform it on the promised object.

benjamingr commented 1 year ago

Development on bluebird has virtually stopped. We will still fix security issues but Petka is pretty much gone from here and social (for now) and releases are tricky (I would have to go through npm contacts or Petka's wife which I met).

Your suggestion can be a library though?