Async Class

Dimitrian Nine dimtimeforever at
Mon Aug 26 15:11:37 UTC 2019

Ok so much time has passed. I have learned more js. And created some
[wrapper][1] for my idea:
Class is just function constructor that return object
Async Class is async function constructor that returns promise object.
Wrapper code:
class PromiseClass { //promisified class
static async new(obj){ return obj;}
constructor() {return; }//new
class AsyncClass extends PromiseClass{ // can ext Class|PromiseClass
static async new(obj){return await obj();}
constructor(){return>{await super(); return
And we work with Async Class like we work with functions. I dont see here
some differents to use them. Code without wrapper be clean:
async class PromiseClass { //return Promise
constructor() {}//async()=>Promise object
async class AsyncClass extends PromiseClass{ // can ext Class|PromiseClass
constructor(){ await super();} //async()=>Promise object
вс, 25 февр. 2018 г. в 11:47, Dimitrian Nine <dimtimeforever at>:

> ([Classes][1]):
> [1]:
> «JavaScript classes, introduced in ECMAScript 2015, are primarily
> syntactical sugar over JavaScript's existing prototype-based inheritance.
> The class syntax does not introduce a new object-oriented inheritance model
> to JavaScript»
> «Classes are in fact "special functions"»
> ```js class = function Create(); ```
> all i want:
> ``` js async class = async function Create(); ```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list