1.65.4 • Published 1 year ago

@biorate/inversion v1.65.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Inversion

IoC core module build on InversifyJS

Example:

import { Core, init, injectable, inject, container, kill } from '@biorate/inversion';

@injectable()
class One {
  @init() public initialize() {
    console.log('One module initialized');
  }

  @kill() public kill() {
    console.log('One module killed');
  }
}

@injectable()
class Two {
  @init() public initialize() {
    console.log('Two module initialized');
  }
}

@injectable()
class Three {
  @init() public initialize() {
    console.log('Three module initialized');
  }
}

class Root extends Core() {
  @inject(One) public one;
  @inject(Two) public two;
  @inject(Three) public three;
}

container.bind(One).toSelf();
container.bind(Two).toSelf();
container.bind(Three).toSelf();
container.bind(Root).toSelf();

const root = container.get(Root);

root.$run().then(() => {
  console.log(root.one instanceof One); // true
  console.log(root.two instanceof Two); // true
  console.log(root.three instanceof Three); // true
});

Learn

  • Documentation can be found here - docs.

Release History

See the CHANGELOG

License

MIT

Copyright (c) 2021-present Leonid Levkin (llevkin)

1.65.4

1 year ago

1.54.0

1 year ago

1.42.2

2 years ago

1.42.1

2 years ago

1.30.12

2 years ago

1.29.0

2 years ago

1.28.1

2 years ago

1.28.0

2 years ago

1.27.2

2 years ago

1.27.0

2 years ago

1.27.1

2 years ago

1.26.0

2 years ago

1.24.0

2 years ago

1.11.2

3 years ago

1.0.0

3 years ago

1.4.0

3 years ago

1.2.2

3 years ago

0.30.7

3 years ago

0.30.6

3 years ago

0.30.5

3 years ago

0.30.2

3 years ago

0.30.0

3 years ago

0.30.19

3 years ago

0.29.1

3 years ago

0.28.0

3 years ago

0.27.0

3 years ago

0.26.0

3 years ago

0.25.0

3 years ago

0.21.0

3 years ago

0.20.0

3 years ago

0.19.0

3 years ago

0.18.2

3 years ago

0.23.0

3 years ago

0.22.0

3 years ago

0.16.3

3 years ago

0.12.0

4 years ago

0.13.0

3 years ago

0.12.1

4 years ago

0.14.0

3 years ago

0.12.2

4 years ago

0.15.0

3 years ago

0.14.1

3 years ago

0.15.1

3 years ago

0.17.0

3 years ago

0.16.1

3 years ago

0.15.2

3 years ago

0.18.0

3 years ago

0.11.0

4 years ago

0.10.1

4 years ago

0.10.2

4 years ago

0.10.3

4 years ago

0.10.4

4 years ago

0.10.0

4 years ago

0.9.3

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago