I have this RxJS code in my Angular project:
settingsService.getSetting('setting-name').pipe(
map((setting: SettingInterface) => {
// ...
return setting;
}),
tap((setting: SettingInterface) => this.settingService.save(setting)),
map((setting: SettingInterface) => {
// ...
})
);
In this code the this.settingService.save(setting) is an Observable too, and it isn't subscribed.
How can I start this observable in the pipe, wait for it and continue?
Important:
- the
save()observable must start after prevoiusmap()operator - the result of the
save()observable is irrelevant in the pipe and I want to drop it - the
save()observable must start before nextmap()operator
Is there any RxJS operator to do this?