So the answer to "How do I do mixins in JS?" is crickets? It's seems like such an obvious pattern in so many cases… and yet…
-
-
Right,
@justinfagnani's 2015 post (http://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/ …). It's just very weird no one seems to use those anywhere. -
It's more or less the plan of record for Ember. I presented this pattern to TC39 before Justin's post even. "mixins are broken; composition over inheritance yo" is the winner atm.
-
I think we could use a maximally minimal mixins proposal that just desugars to this. It's be a boon for static analysis.
-
Yeah, that would be awesome and consistent with classes.
-
This is more or less my preferred solution. There's a lot of class features in flight right now, but this feels like a good next step.
End of conversation
New conversation -
-
-
Next step, decorator to encapsulate the pattern:
@mixin(Enumerable, Comparable) class X {} -
Ah! So it is going somewhere AND there is a plan. <3
-
First the community needs to get over the "ding dong the OO is dead" irrational exuberance
- 1 more reply
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.