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

Feature idea: supply a decorator API?

オープン
#144 コメント 8 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
367
フォーク
158
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。