OOP: constructors and eventsToday I would like to spend some words about this code: public class Consumer { private IThing _field; private IProducer _producer; public Consumer(IProducer producer) { _producer = producer; _producer.MyEvent += Hand...Apr 18, 2025 · 5 min readbite-sized.hashnode.dev
How to type function returned values according to inputI found myself in a situation where I needed to correctly type a function's result based on the arguments passed to it. For the sake of simplicity, consider a function that reads URL params and has the following requirements: such function will take...Jul 26, 2024 · 7 min readbite-sized.hashnode.dev
Some REST API tricksRESTful APIs are a well known concept in API design. They allow developers to leverage HTTP URLs and verbs to create versatile interfaces for CRUD operations as well as searching and filtering. As a small recap, here are the HTTP verbs and what they ...1IJun 28, 2024 · 3 min readbite-sized.hashnode.dev
I was rejected from a role I did not applied forWhen I was open to new job opportunities, I was prepared to face any oddities out there on the market. But the harsh reality is that I cannot be prepared to anything. I can encounter some common scenarios and know how to deal with them, but crazy thi...May 31, 2024 · 3 min readbite-sized.hashnode.dev
The deferred Promise antipatternHave you ever heard about deferred Promise? If you are a seasoned Javascript developer like me, I bet you did. If it's not the case, then you're lucky! Back at the time when I had to migrate a huge codebase from Q promises to ES6 promises, such codeb...Apr 26, 2024 · 5 min readbite-sized.hashnode.dev