I am learning emberjs right now and i was wondering if it is a common way to make fetch request inside a function (for example for button clicks) in component classes and store the data in the class component. For example:
export default class ExampleComponent extends Component {
@tracked items;
@action async toggleCall() {
await fetch(...)
.then(...)
}
}
Or do you do this in a different way in emberjs?
Aucun commentaire:
Enregistrer un commentaire