Skip to content

Instantly share code, notes, and snippets.

@tomdale
Created October 4, 2019 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomdale/ed53b7435777c6ba46b84062043553db to your computer and use it in GitHub Desktop.
Save tomdale/ed53b7435777c6ba46b84062043553db to your computer and use it in GitHub Desktop.
bind vs. action decorators
import Component, { tracked, action } from '@glimmer/component';
export default class extends Component {
@tracked count = 0;
@action increment() {
this.count++;
}
}
import Component, { tracked } from '@glimmer/component';
import { bind } from 'decko';
export default class extends Component {
@tracked count = 0;
@bind increment() {
this.count++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment