How it says: "there is no limit to perfection" - [new wrapper][1]. Now it
works like more native:
```js
class PromiseClass {
static async new(test='test'){ this.promise= test; return this;}
constructor(...args) {
let s = async()=>PromiseClass.new.call(this,...args);
return (async r=>await s()
>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
Not a bad idea, but I'd *strongly* prefer the promise to be returned
from `new AsyncClass(...)` itself instead. And down that vein, `super`
with async classes should also implicitly `await` in its `super` call,
setting `this` to the value itself. For sanity reasons, `super` should
return a promise
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:
```js
class PromiseClass { //promisified class
static async
4 matches
Mail list logo