leosan
03/13/2018, 12:36 PMString
tag for a job and the instance of the job
but not sure if this is a factory, a provider…
what would be similar to this using Kodein
@Singleton
class AppJobCreator
@Inject constructor(
private val jobs: @JvmSuppressWildcards Map<String, Provider<Job>>
): JobCreator {
override fun create(tag: String): Job? {
val jobProvider = jobs[tag]
return jobProvider?.get()
}
}