adopted-ember-addons / adopted-ember-addons/ember-metrics

Feature idea: supply a decorator API?

Open
#144 8 comments 2 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.