gertqin / vuex-class-modules

Typescript class decorators for vuex modules
MIT License
193 stars 20 forks source link

Emit new child class in @Module decorator #10

Closed bodograumann closed 5 years ago

bodograumann commented 5 years ago

Instead of reusing the prototype of the constructor to be decorated directly, we create a child class and thus keep the whole original class intact.

Previously any metadata on the undecorated module class was lost. Now it lives on in the prototype chain. Cf. https://github.com/rbuckton/reflect-metadata

Fixes #9

bodograumann commented 5 years ago

All the existing tests pass :smile: Mmh, maybe I should add another one for the specific issue I’m trying to fix here.