Skip to content

How do you compare to typed-inject and other alternatives ? #18

Answered by vovaspace
jpbourgeon asked this question in Q&A
Discussion options

You must be logged in to vote

Hi. Thank you for your question.

I took the time to get a better understanding of Typed Inject, and here are the differences I saw:

  • The Brandi tokens mechanism. Typed Inject suggests resolving dependencies in this way: const myService = appInjector.injectClass(MyService);. In this case, your code still depends on the MyService class constructor, instead of depending on the typed token as Brandi suggests: const myService = container.get(myServiceToken);
  • Brandi provides a different mechanism for hierarchical containers. It fits perfectly with the hierarchical structure of the React-components;
  • Both libraries have two identical dependency scopes: Transient and Singleton. However, Brandi has…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jpbourgeon
Comment options

Answer selected by vovaspace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants