Skip to content

Commit

Permalink
[core] build with module list
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Giuliani committed Sep 11, 2017
1 parent e8aab26 commit fd4891c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions koin-core/src/main/kotlin/org/koin/Koin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class Koin {
}

/**
* load given module instances into current koin context
* load given list of module instances into current koin context
*/
fun <T : Module> build(vararg modules: T): KoinContext {
fun <T : Module> build(modules: List<T>): KoinContext {
logger.info("load module $modules ...")

val koinContext = KoinContext(beanRegistry, propertyResolver, instanceResolver)
Expand All @@ -54,6 +54,11 @@ class Koin {
return koinContext
}

/**
* load given module instances into current koin context
*/
fun <T : Module> build(vararg modules: T): KoinContext = build(modules.asList())

/**
* load directly Koin context with no modules
*/
Expand Down

0 comments on commit fd4891c

Please sign in to comment.