In other words it seems like class decorator now has to return an object. Whereas in the past it could just return a new function alone.
You can probably accomplish your use case with class finishers, but @littledan and I recently changed the spec to require a subclass iirc
-
-
We should look at this use case to see if "constructor replacement" is a feature we need to add back.
-
By that do you mean returning a NEW constructor? ie `Class => class extends Class{}`? If so yeah, that would be incredibly handy.
-
That's not what HOCs do though. They return a completely different class.
-
Right Class => class extends Class ie they return a NEW class, like connect. Did you reply to the wrong tweet? :)
-
Ah sure. Doesn't *have to* be Class => class extends Class could just be Class => class { /* somehow ref Class */ } either way - NEW class
-
Corollary to the above: this would be a massive breaking change to not only stage 1, but also TypeScript class decorators.
-
Let's take this off Twitter. I approved the change because I didn't know the use case.
-
I'm happy to help in any way I can, wherever :) just let me know
- 13 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
