Using NestJS Interceptors to Centralize Cross-Cutting Concerns
Controllers often repeat logging, timing and DTO mapping. NestJS interceptors wrap handler execution with RxJS to centralize these concerns without touching the handler code.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Controllers often repeat logging, timing and DTO mapping. NestJS interceptors wrap handler execution with RxJS to centralize these concerns without touching the handler code.
Learn how to eliminate asynchronous race conditions in search inputs using RxJS switchMap to cancel stale network requests and ensure UI consistency.
Stop race conditions in Angular. Learn when to use switchMap, exhaustMap, concatMap, and mergeMap in NgRx Effects to handle API calls and user inputs correctly.
Learn how RxJS’s shareReplay operator turns a cold Observable into a multicast source, caches emissions, and why refCount:true matters. See a concrete example, version‑specific notes, and common mistakes to avoid.
Learn how switchMap cancels previous HTTP observables in Angular services to avoid stale search results, with a code example, trade‑offs, and verification steps.
Learn how RxJS shareReplay prevents duplicate HTTP requests in Angular by multicasting and caching the latest emission, with a concrete service example and verification steps.
Learn how to apply RxJS shareReplay for caching UI data streams: requirements, minimal design, trust boundaries, operational tests, failure modes, and verification steps.
Error condition Calling next() , error() , or complete() on a Subject after its internal subscription list has been cleared via unsubscribe() throws an ObjectUnsubscribedError with the message "object unsubscribed". The check occurs in Subject.next() when this.observers.length === 0 . Component context Subject extends Observable and implements SubscriptionLi
Decide whether to use switchMap or mergeMap for RxJS user input streams. Compare constraints, trade‑offs, and see a concrete search‑box example.