adopted-ember-addons / adopted-ember-addons/ember-metrics
Feature idea: supply a decorator API?
- Dominant language
- TypeScript
- Stars
- 367
- Forks
- 158
- PR merge metrics
- No merged PRs in 30d
Description
This is obviously a bit out before we could land it, but as I was looking at the current (really solid) API it occurred to me that class method decorators (after ES6-style classes land… 🤞) could make for a really nice API:
```js
import { trackEvent } from 'ember-metrics';
class Foo extends Component {
@service metrics;
@trackEvent('some-action-yeah')
someMethodWhichShouldTriggerAnAction() {
// ...
}
}
```
That's obviously a very rough idea, and obviously it's quite a ways before we could land it, but I figured I'd throw it out as something to start thinking through – including even whether it's a good idea – ahead of time.
Contributor guide
Assessment
This issue has not been assessed yet.