Our great sponsors
-
InversifyJS
A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
Hi, I know that there are some solutions out there to deal with IoC containers in TypeScript, like Inversify, but so far, and after many days exploring the Internet looking for a "nice" solution, I didn't find anything alike to what I just came up with... So there's a chance that this is really a novelty when it comes to TS patterns :) , who knows.
I believe this can be very valuable, mostly when the TypeScript community has been asking for features such as the nameof operator ( #43325, #40846, etc. ) precisely because of this use case.
I've toyed with a similar pattern, albeit a purely functional one https://github.com/tom-sherman/diddly