ember-command
ember-command copied to clipboard
LinkCommand to accept a Link instance
Allow this to work:
class MyComponent extends Component {
link = this.linkMananger.createLink({...});
@command = commandFor([new LinkCommand(this.link)]);
}
which would enable this:
{{! invocation }}
<MyComponent @link={{link "..."}}/>
{{! template.hbs
<Button @push={{this.go}}>let's go</Button>
and
interface Args {
link: Link;
}
class MyComponent extends Component<Args> {
@command
go = commandFor([
new LinkCommand(this.args.link),
new OtherCommand()
]);
}