Abstract problem: Every time a source Observable emits and event, a sequence of API calls and Angular services need to be triggered. Some of those invocatio
Could you use an object for the set of data? Something like this:
Interface:
export interface Packet {
event: string;
headers?: string;
id?: number;
pdfId?: number;
cloudId?: number;
}
Then in the code, something like this:
Service:
this.startUploadEvent$.pipe(
concatMap(packet => this.doThingOne(packet)),
map(packet => this.doThingTwo(packet)),
tap(packet => this.doThingThree(packet)),
// ...
);
That way each method can use the bits of the object it needs and pass along the rest. Though this does require changing each of the methods to take in and work with the object.