Async Class

Dimitrian Nine dimtimeforever at
Tue Aug 27 04:47:00 UTC 2019

 How it says: "there is no limit to perfection" - [new wrapper][1]. Now it
works like more native:

class PromiseClass {
static async new(test='test'){ this.promise= test; return this;}
constructor(...args) {
let s = async()=>,...args);
return (async r=>await s() )();
class AsyncClass extends PromiseClass{
static async new(){ return this; }
let s = async()=>{ await super(); return,...args); };
return (async r=>await s() )();

вт, 27 авг. 2019 г. в 07:42, Dimitrian Nine <dimtimeforever at>:

> >Not a bad idea, but I'd strongly prefer the promise to be returned from
> new >AsyncClass(...) itself instead
> This about wrapper? He is just example of how functional can work right
> now.
> >I do have a preference: async should decorate the constructor, not the
> class
> How i say before: both variants fine for me.
> But how discussed [here][1] - not all think same.
> For me Class is just wrapper on constructor
> And Async Class is same only for async constructor.
> [1]:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list