evant
06/14/2021, 4:06 PMevant
06/14/2021, 4:37 PMinterface AppComponent
@ContributesTo(AppComponent::class)
abstract class MyComponent1
@ContributsTo(AppComponent::class)
abstract class MyComponent2
generate
@Component
abstract AppComponentImpl : AppComponent, MyComponent1, MyComponent2
which... I'm not sure is worth it? Maybe I'm missing use-cases here.evant
06/15/2021, 1:16 PMsaket
10/27/2021, 10:56 PMUnresolved reference
bug in your sample: https://github.com/evant/kotlin-inject-samples/pull/3saket
11/06/2021, 4:27 AM0.3.8-SNAPSHOT
yetsaket
11/06/2021, 6:06 AMprotected val RealHttp.bind: Http
@Provides
@SomeScope
get() = this
@Provides
@SomeScope
fun http(real: RealHttp): Http = real
saket
11/07/2021, 2:52 AMPaul Woitaschek
11/10/2021, 1:05 PMPaul Woitaschek
11/10/2021, 2:25 PMeygraber
11/11/2021, 4:51 AMMainComponent
there is a generated fun KClass<MainComponent>.create()
however I can't reference it from my code.saket
11/12/2021, 5:26 AMeygraber
11/23/2021, 5:52 AMdave08
12/16/2021, 1:50 PMevant
01/11/2022, 3:02 PM@Provides @IntoSet fun provideFoo(): () -> Foo = { FooImpl() }
evant
01/11/2022, 3:06 PMtypealias Foo1 = Foo
typealias Foo2 = Foo
@Provides @IntoSet
fun foo1ForSet1(): Foo1 = ...
@Provides @IntoSet
fun foo2ForSet1(): Foo1 = ...
@Provides @IntoSet
fun foo1ForSet2(): Foo2 = ...
@Provides @IntoSet
fun foo2ForSet2(): Foo2 = ...
@Provides @IntoMap
fun fooSet1(set: Set<Foo1>): Pair<String, Set<Foo>> = "one" to set
@Provides @IntoMap
fun fooSet2(set: Set<Foo2>): Pair<String, Set<Foo>> = "two" to set
dave08
01/17/2022, 4:53 PMfun inject(someActivity: SomeActivity)
...? It's SO MUCH nicer than having to do the trick in the Android docs on kotlin-inject's Github repo...eygraber
02/22/2022, 6:11 AM@Inject
to a typealias?
My use case is where I have a type that I want to use in two different scopes:
class Foo
@AppScope
@Inject
typealias AppFoo = Foo
@ScreenScope
@Inject
typealias ScreenFoo = Foo
Currently I have to use provider functions, which is a lot more verbose, especially since I now need a component for those function:
@Component
abstract class FooComponent {
@AppScope @Provides fun provideAppFoo() = AppFoo()
@ScreenScope @Provides fun provideScreenFoo() = ScreenFoo()
}
(this example is contrived, but I do have an actual use case for something like this)eygraber
02/27/2022, 6:02 AMclass ResolverWrapper(val resolver: ContentResolver)
@Component abstract class ParentComponent {
@Provides fun providesContentResolve(context: Context) = context.contentResolver
}
@Component abstract class ChildComponent(
@Component val parent: ParentComponent,
@get:Provides val context: Context
) {
abstract val wrapper: ResolverWrapper
}
The above works, but is it OK to rely on this behavior?humblehacker
03/16/2022, 8:05 PM@Composable
function? If I do it as I would for a non-composable function, I get a new view model every time my view is recomposed.humblehacker
04/08/2022, 12:54 AM@Components
forming a tree of dependencies? I'm modularizing an app previously set up with kotlin-inject, and I'm running into issues. I'm hoping that by looking at a working example I can avoid having to ask a bunch of questions.evant
04/21/2022, 8:55 PM@Binds(in = AppComponent::class)
@Inject
class MyImpl : Impl
but it just feels like shuffling things around? It's also nice to have them all in one place so you can override them all for tests (a common usecase for having multiple impls for an interface).evant
06/09/2022, 5:44 PMPaul Woitaschek
07/19/2022, 11:31 AMPaul Woitaschek
07/23/2022, 3:25 PMevant
08/03/2022, 4:49 AMPaul Woitaschek
08/03/2022, 3:07 PMPaul Woitaschek
08/03/2022, 3:09 PMType aliases do not introduce new types. They are equivalent to the corresponding underlying types.I think a dedicated Qualifier annotation would make things simpler to everyone.
evant
08/04/2022, 6:05 PMevant
08/05/2022, 9:44 PMevant
08/05/2022, 9:46 PMevant
08/05/2022, 9:46 PM