Skip to content

Commit bd389fa

Browse files
committed
convert es-button to a glimmer component
1 parent e0dbe9f commit bd389fa

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

addon/components/es-button.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
import Component from 'sparkles-component';
1+
import Component from '@glimmer/component';
22

3-
export default class EsButton extends Component {
3+
export default class EsButtonComponent extends Component {
4+
// default value
5+
_onClicked = () => {};
46

5-
constructor({ onClicked }) {
7+
constructor() {
68
super(...arguments);
79

8-
if(!onClicked) {
10+
11+
if(!this.args.onClicked) {
912
// eslint-disable-next-line no-console
1013
console.warn(new Error('Button created with no onClicked'));
11-
this.onClicked = function() {};
1214
} else {
13-
this.onClicked = onClicked;
15+
this._onClicked = this.args.onClicked;
1416
}
1517
}
1618

1719
buttonClicked() {
18-
this.onClicked();
20+
this._onClicked();
1921
}
2022
}

0 commit comments

Comments
 (0)