Comparing polytype with other methods #16
AbdealiLoKo
started this conversation in
Ideas
Replies: 1 comment
-
I don't know any good resources for what you are asking, but if a well-written article existed I'd be happy to link to it in the documentation. Maybe under a new section Alternatives, or similar. Mixins are often a good solution - especially in TypeScript, where types are immutable - but there are more alternatives. I've converted the original issue into a discussion for now, let's see if we can collect more ideas. Thanks for opening this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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 -
Object.assign(MyClass.prototype, MyMixin);
(which does not allow me to use super(), instanceof, doesnt handle typing, etc.)And so on.
Beta Was this translation helpful? Give feedback.
All reactions