Implement ReturnType<T> Utility Type from Scratch in TypeScriptHey there, TypeScript tinkerers! 👋 Ever thought about how doesReturnType<T> works under the hood? Today we’re going to build our own version of ReturnType<T> from the ground up, so you can see how it works under the hood. Let’s dive in! Why do I nee...2 min read·anmol-kansal.hashnode.devJun 17, 2025
Why TypeScript Fails to Infer Types in Your Switch StatementsTypeScript’s type inference system is incredibly powerful — but it also has strict rules designed to keep your code predictable and safe. Sometimes, those rules can feel overly cautious. A common example? Using a switch statement with discriminated u...3 min read·anmol-kansal.hashnode.devApr 18, 2025
🔄 Global State in React Without Context API or External LibrariesManaging the global state is a common challenge in React. While tools like Redux, Zustand, or even React’s built-in Context API are popular choices, they can sometimes feel like overkill for simpler use cases. What if you could share the state betwee...2 min read·anmol-kansal.hashnode.devApr 5, 2025
Implementing a Polyfill for Promise.allSettled() in JavaScriptIn this post, you will learn how to implement a polyfill for Promise.allSettled() from scratch3 min read·anmol-kansal.hashnode.devMar 28, 2025
🚀 Implementing a Polyfill for Promise.all in JavaScriptIn this post, you will learn how to implement a polyfill for Promise.all in JavaScript2 min read·anmol-kansal.hashnode.devMar 15, 2025