Haiyn / xenon-the-antiquarian-bot

GNU General Public License v3.0
0 stars 0 forks source link

Asynchronously inject confinode configuration #33

Closed Haiyn closed 3 years ago

Haiyn commented 3 years ago

Instead of calling container.get<Configuration>(TYPES.Configuration) everytime it is needed, instead bind it in the inversifyjs config as a new type and inject it into all services/classes that need it.

Problem: Classes are built internally by inversifyjs before the confinode initialization has binded the configuration to the container. The construction of the class then fails. Solution: Use the async Provider functionality (https://github.com/inversify/InversifyJS/blob/master/wiki/provider_injection.md) Inject the Provider into the class and provide the class with the actual configuration once its binded.

Haiyn commented 3 years ago

Confinode is not used anymore.