Search
Lessons (8)
- Behavioral Patterns II: Chain, Template, Iterator, Mediator, Memento, Visitor
Six more behavioral patterns, from Express-style middleware chains to undo snapshots, each with a picture and a …
- O — Open/Closed Principle
… StudentDiscount : 🆕 added later OCP is everywhere you look Tool Extension point --- --- Express / Koa Middleware: app.use(myMiddleware) VS …
- Which Pattern Do I Need?
… 2. 🔌 Adapter — wrapping 3rd-party libraries 3. ☕ Decorator — middleware, HOCs, retry/cache/log wrappers 4. 🏨 Facade — service layers …
- How a Web Request Works
… through layers: mermaid flowchart LR R[Request] -- M["Middleware<br/ logging, auth, rate limit"] -- Rt[Router] -- C[Controller …
- What Are Design Patterns?
… pattern --- --- button.addEventListener("click", fn) Observer app.use(middleware) in Express Chain of Responsibility array.sort((a, b …
- Clean Error Handling
… Throw specific errors, and let one middleware turn them into HTTP responses. js // routes just throw app.get …
- State Management (Redux, Zustand, TanStack Query)
… strict conventions, excellent DevTools (time-travel debugging) and middleware. RTK Query adds server-state caching, similar to TanStack …
- Structural Patterns: How to Connect Objects
… withRetry] -- F[fetchUser] You've used it: Express middleware, React Higher-Order Components ( withRouter(Component) ), TypeScript/NestJS @decorators …