A module that encapsulates related dependency bindings. Modules provide a way to organize and group related bindings together, making them easier to manage, load, and unload as a unit.
const databaseModule = new PluginModule(({ bind, bindOnce, rebind }) => { bind('connection').factory(() => createConnection()).singleton(); bind('repository').class(UserRepository).singleton();});container.load(databaseModule); Copy
const databaseModule = new PluginModule(({ bind, bindOnce, rebind }) => { bind('connection').factory(() => createConnection()).singleton(); bind('repository').class(UserRepository).singleton();});container.load(databaseModule);
Readonly
A module that encapsulates related dependency bindings. Modules provide a way to organize and group related bindings together, making them easier to manage, load, and unload as a unit.
Example