typescript-mix
typescript-mix copied to clipboard
A tweaked implementation of TypeScript's default applyMixins(...) idea using ES7 decorators
Suppose we have four classes: **A**. **B**, **C** and **B0**: class **A** { } class **B0** { } class **B** extends **B0** { } class **C** { @use(**A**, **B**) this;...
Great work here, very simple intuitive API. I read on your medium article that it would be easy to test mixins to by instantiating them. Would you be able to...
``` ERROR in D:/git/aca-stages/src/components/InternshipsSchedule.vue(994,4): 994:4 This expression is not callable. Type 'typeof import("D:/git/aca-stages/node_modules/typescript-mix/dist/index")' has no call signatures. 992 | }) 993 | export default class InternshipsSchedule extends Vue { >...
I think it would kind off make more sense for the @use decorator to be applied on classes instead of a property 'this:any'. So for example: ``` class Mixable {}...
Closes #10
Is it possible to define the mixin under a different key space? ```js class Main { @use(OtherClass, 'other') this; } ``` such that ```js const m = new Main(); m.other.*...
This looks really cool! Can I use this without decorators? I'm using sucrase for fast builds, but it doesn't support decorators (since it's not fully standardized).