Skip to content

Instantly share code, notes, and snippets.

Last active September 16, 2021 12:30
What would you like to do?
JavaScript dependency injection (DI) libraries

Compilation + Runtime


Implementations based on reflect-metadata

Implementations not based on reflect-metadata

A benefit of using reflect-metadata is that you don't have to declare dependency for classes.


class A {
  constructor(private readonly b: B) {}

The injector will know that A depends on B.

Compare to

class A {
  constructor(@Need(B) private readonly: B) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment