Dipstick – A new way to DI in TS
Dipstick – A new way to DI in TS
For whatever reason, every attempt at DI in this language that I've found over the last few years is more-or-less a port of an existing DI framework for languages like C# or Java/Kotlin, but they leave a lot to be desired. JS doesn't have TS types at runtime, so these frameworks tend to hack around that idea by muddying up source code with `@Decorators` or creating unique tokens to represent types. I personally find these hacks to be pretty ugly. What's worse, they violate the principle of least surprise (especially for devs who aren't familiar with DI), and they often result in code that's not type-safe! Dipstick takes a totally different approach, which leverages the type system and code generation. - Simple. There are only two concepts to learn about: Modules and Bindings. - Obvious. Want to see where a class is instantiated? Let your IDEs tools do the work. No tricky reflection or abstraction here -- just readable, generated code. - Modular. Define multiple modules and compose them together to keep code organized. The framework is still really young, and currently only supports classes (boo), but if it gets some traction, I will update it to support injecting functions or other literal values. I'd really love some feedback to make this thing better!
Share cardActual performance
Launch Intel predictions
Analyze your own launch →Correct prediction on native model
Similar products
A new way of ORM in Java
A new way to do footnotes
A new way of eating out – by dropping in
Zaundy, the new way to get your voice out
New way to social.
ChattySurvey – a new way to discover PMF
LeapFM - A new way to find music
New way for connect GoPro to OBS wireless
New way to find and book venues
Alexandria, a New Way to Read the Classics