You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to figure out inheritance / mixin approach for the past few days.
And I've seen a few methods around
polytype seems to be the most robust approach I have come acorss based on the documentation so far.
I was wondering if there was some nice comparison of some of the common approaches and pitfalls or other approaches that could exist ?
For example -
The single inheritance available in JS now prototype replacement (which does not allow multiple inheritance)
The approach of modifying the prototype of classes - like Object.assign(MyClass.prototype, MyMixin); (which does not allow me to use super(), instanceof, doesnt handle typing, etc.)
The approach mentioned in typescript's mixin documentation right now about dynamic classes inherited in a function (Which has a bit of an awkward syntax ? But seems to handle everything else ?)
ts-mixer
And so on.
Reactions are currently unavailable
Activity
Repository owner locked and limited conversation to collaborators on May 30, 2022
Activity