-
I have the following component that preloads some data, which results in an export default class MyComponent extends Component {
@service store;
@tracked comments = [];
constructor() {
super(...arguments);
this.preloadCommentsTask.perform();
}
@task
*preloadCommentsTask() {
this.comments = yield this.store.query('comment', {});
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
Turbo87
Dec 16, 2021
Replies: 1 comment 1 reply
-
if this is strictly about preloading and you want to ignore all possible errors then something like: this.preloadCommentsTask.perform().catch(() => {
// we are actively ignoring all errors here, because this task is only used to preload the data
// and if it fails the user experience is not affected that much
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
iamdtang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if this is strictly about preloading and you want to ignore all possible errors then something like: