module

inline fun <M : Module> module(identifier: String? = null, noinline factory: DependenciesGraph.() -> M)

Registers a module factory.

Parameters

identifier

An optional identifier key associated with the instance built via factory. The same identifier can be used to register multiple instances of the same module type and can then be used to retrieve the module via dependency or optionalDependency.

factory

Factory building scope executed in the completely built DependenciesGraph that returns an instance of the module.