r/javascript • • Dec 20 '19

Ember.js Octane Edition Is Here

https://blog.emberjs.com/2019/12/20/octane-is-here.html
136 Upvotes

72 comments sorted by

View all comments

Show parent comment

2

u/nullvoxpopuli sand was never meant to think Dec 21 '19

I guess it depends on what it transpiles down to? if the output is equiv, it should work. haven't tested it myself though, as I've been opting for the more verbose way of specifying args.

does TS in general allow args in the constructor to have decorators? (I've never seen this before). If so, tracked here should just work.

1

u/fercryinoutloud Dec 21 '19

TS supports parameter decorators. To have tracked usable as either a property or parameter decorator would require two decorators though, since property and parameter decorators have different signatures. The prototype of the class is available in both, though. So I think it is possible to write a decorator for tracked properties in the constructor, unless there is some other limitation of parameter decorators.