1
0
Fork 0
sortable-recipes/app/components/recipe-add.js
2019-12-22 12:10:00 -06:00

17 lines
438 B
JavaScript

import Component from '@glimmer/component';
import { inject as service } from '@ember/service';
import { task } from 'ember-concurrency';
import { action } from "@ember/object";
export default class RecipeAddComponent extends Component {
@service store;
@(task(function * () {
return yield this.store.queryRecord('meal', 'random');
})) fetchRecipe;
@action
async addRecipe() {
await this.fetchRecipe.perform();
}
}