Angular Example — Observable Pipelines
readonly data$ = combineLatest([a$, b$, c$]).pipe(
switchMap(([a, b, c]) => this.api.load(a.id, b.key, c.value)),
retry({ count: 3 }),
shareReplay({ bufferSize: 1, refCount: true }),
);
readonly params$ = combineLatest([a$, b$, c$]);
readonly data$ = params$.pipe(
switchMap(([a, b, c]) => this.api.load(a.id, b.key, c.value)),
shareReplay(1),
);
- Name intermediate values; avoid clever one-liners
- Use shareReplay(1) in UI; avoid exotic configs unless needed