Skip to main content

2 posts tagged with "patterns"

View All Tags

How we use dependency injection with TypeScript at Orus

· 6 min read
Marvin Roger
Marvin Roger
Senior Software Engineer
Cover

Curiously, dependency injection is not something that we often see in the JavaScript ecosystem.

Still, it's a powerful pattern that can help you make your code more flexible and easier to test, if implemented properly.

After a lot of iterations, we've come up with a dependency injection system that works well for us at Orus. The point of this article is not to cover exactly how dependency injection works, but rather to share our learnings in building it.

Future-proof union values handling with TypeScript

· 7 min read
Samuel Rossille
Samuel Rossille
CTO
Cover

Unions and discriminated unions are great tools that can make the code flexible, while keeping the complexity to a low level. But tiny differences in the style of the code that uses them can make the difference between robust code, and bugs waiting to happen.

In this article, we will dive into two patterns that can help us make our code more future-proof.

But before "future-proofing" our code, let's remember that many technical debt nightmares originate from unfortunate attempts to be future-proof.

So let's be clear about what we mean by future-proof code.

Early abstraction meme