You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to registerFactory but with dependencies?
For example in Kotlin Koin will be like
val networkModule = modules {
single { RetrofitInstance() }
}
val repoModule = modules {
//userRepo depends on RetrofitInstance
factory { UserRepository(get()) }
}
How to achieve this in get_it?
I created the setup like this
GetIt locator = GetIt.instance;
void setupGetIt() {
locator.registerSingleton(AppDatabase());
//then how to register UserRepository with dependencies?
}
There is only registerSingletonWithDependencies available, registerFactoryWithDependencies is not exists.
Or maybe there is another approach to achieve this?
The text was updated successfully, but these errors were encountered:
IMHO dependencies don't really make sense for a factory. If you need to be sure that another registered object is available use allReady or isReady to wait for it.
How to registerFactory but with dependencies?
For example in Kotlin Koin will be like
How to achieve this in get_it?
I created the setup like this
There is only registerSingletonWithDependencies available, registerFactoryWithDependencies is not exists.
Or maybe there is another approach to achieve this?
The text was updated successfully, but these errors were encountered: