Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Advanced JavaScript Async Patterns: The Promise.all Family, Cancellation, Retry and Timeouts
We look at the differences between Promise.all, allSettled, any and race, ES2024's Promise.withResolvers, ES2025's Promise.try, supporting AbortSignal in your own functions, retry, timeouts and concurrency limits.
Asynchronous Code in TypeScript: Typing Promise, async and fetch Responses
We look at Promise<T> and async return types, why a fetch response is any, runtime validation with unknown and hand-written type guards, and the types of Promise.all and allSettled.
JavaScript async/await: Readable Async Code, Error Handling and Waiting in Parallel
We see why async functions always return promises, how await waits without freezing the page, catching errors with try/catch, sequential versus parallel waiting, the await-in-a-loop trap and top-level await.
JavaScript Promises: Three States, the then/catch/finally Chain and Error Propagation
We build the three promise states with a restaurant buzzer analogy and work through new Promise, then/catch/finally, chaining, error propagation, Promise.all and race, and wrapping callbacks.