mobx: @action decorator fail with typescript targeting ES3
The @action decorator seems to have no effect when compiled with typescript.
Here is a codepen: https://codepen.io/testerez/pen/qNKVvO
The generated JS shows that typescript at least tries to apply the decorator:
__decorate([
action
], Data.prototype, "increment");
Switching to babel fixes the issue. Is that a typescript issue? I experience the same issue with typescript@beta (2.0)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 18 (12 by maintainers)
@mweststrate, you can try
npm run full-testin this branch https://github.com/andykog/mobx/tree/reflectDecorateProblem That is a sad picture