o
Size: a a a
o
o
o
PW
PW
PW
o
o
MG
MG
S
А
MG
S
MG
MG
АМ
takeUntil, вот так:load() {
let requests = [
this.loadCheck(),
this.loadStats(),
];
this.isLoading = true;
Promise.all(requests).then(
(response) => this.loadSuccess(response),
(error) => this.loadError(error),
);
}
loadCheck() {
return this.checkService.load(this.checkId).pipe(takeUntil(this.destroyer)).toPromise();
}
loadStats() {
return this.checkService.load(this.checkId, 'statistics').pipe(takeUntil(this.destroyer)).toPromise();
}keUntil резолвится как успешный и в результате в промисе срабатывает `success`-коллбек. А мне нужно, чтобы срабатывал `error`-коллбек. Как это сделать?S
takeUntil, вот так:load() {
let requests = [
this.loadCheck(),
this.loadStats(),
];
this.isLoading = true;
Promise.all(requests).then(
(response) => this.loadSuccess(response),
(error) => this.loadError(error),
);
}
loadCheck() {
return this.checkService.load(this.checkId).pipe(takeUntil(this.destroyer)).toPromise();
}
loadStats() {
return this.checkService.load(this.checkId, 'statistics').pipe(takeUntil(this.destroyer)).toPromise();
}keUntil резолвится как успешный и в результате в промисе срабатывает `success`-коллбек. А мне нужно, чтобы срабатывал `error`-коллбек. Как это сделать?S