Skip to content

Instantly share code, notes, and snippets.

@Oleg-Sulzhenko
Last active June 18, 2019 13:58
Show Gist options
  • Save Oleg-Sulzhenko/090df95239f692064e1e570249ba1227 to your computer and use it in GitHub Desktop.
Save Oleg-Sulzhenko/090df95239f692064e1e570249ba1227 to your computer and use it in GitHub Desktop.
https://stackoverflow.com/questions/52845192/rxjs-stop-propagation-of-observable-chain-if-certain-condition-is-met/52845452 почему subscribe in subscribe это плохо ?? каким оператором отмкнеть предыдущий API call ??
this.service.getFileableSARs()
.mergeMap((res: any) => {
if (!(res.length === 0)) {
this.snackbar.error('There are no pending SAR Reports to file');
this.snackbar.info('Redirecting to overview...');
this.router.navigate([`/sars/batches`]);
} else {
return this.service.generateSARBatch();
}
})
.tap((res) => {
console.log('2 ', res);
return of(res);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment