Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

The Observer Pattern in TypeScript: When You Don't Need RxJS

DEV Community·Gabriel Anhaia·about 1 month ago
#ZQhPZYS9
#typescript#node#rxjs#type#event#stream
Reading 0:00
15s threshold

Book: The TypeScript Type System — From Generics to DSL-Level Types Also by me: The TypeScript Library — the 5-book collection My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools Me: xgabriel.com | GitHub You pick up a ticket. The product spec is one line: "search field should debounce keystrokes for 300ms, then fetch results, and cancel the old request if the user keeps typing." Twenty minutes later, the PR diff is +1 import and a pipe(debounceTime(300), switchMap(fetch)) . The new dependency is RxJS. It is the right tool for some shapes of problem, and it is the wrong tool for the shape of problem most engineers reach for it to solve. The team will carry RxJS for the next six months because nobody wants to be the person who removes it after one component used switchMap . Meanwhile the actual reactive surface area of the app is a search box, a websocket toast notifier, and a "user clicked logout, tear down the side panel" event.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More