romainbsl
03/30/2021, 2:31 PMeygraber
03/31/2021, 3:20 AMromainbsl
03/31/2021, 5:22 AMeygraber
03/31/2021, 2:22 PMromainbsl
03/31/2021, 2:30 PMeygraber
03/31/2021, 5:11 PMromainbsl
04/01/2021, 7:15 AMaerialist
04/02/2021, 12:03 PMaerialist
04/02/2021, 12:04 PMromainbsl
04/02/2021, 12:18 PMbindSet<IPerson>()
val singleton : Singleton<Any, IPerson> = singleton { Person("Salomon") }
inSet<IPerson> { singleton }
bind<IPerson> { singleton }
Note that I've explicited the type of singleton
property
But if your bindings are on different types, you may need to cast one of them:
bindSet<IPerson>()
val singleton : Singleton<Any, IPerson> = singleton { Person("Salomon") }
inSet<IPerson> { singleton }
bind<Person> { singleton as Singleton<Any, Person> }
or stick to the old API.eygraber
04/13/2021, 7:42 PMbindProvider
on a smaller side project to see what it would look like, and the main downside I'm seeing is that it removes the ability to quickly see what type is being bound:
bind<Fragment>() with provider { context }
VS
bindProvider { context }
eygraber
04/13/2021, 7:44 PMbindProvider<Fragment> { context }
but that cause my linter to warn me that the type could be removed (and in some projects it's configured as an error).
As long as the original style of declaring bindings never gets deprecated that will be fine, but if it does it could cause problemsromainbsl
04/14/2021, 7:28 AMbindProvider { context }
is the equivalent to:
bind() from provider { context }
romainbsl
04/14/2021, 7:29 AMbindProvider<Fragment> { context }
is the equivalent to:
bind<Fragment>() with provider { context }
romainbsl
04/14/2021, 7:33 AMbind() from ...
your linter will raise the same warning ?eygraber
04/14/2021, 3:40 PMeygraber
04/14/2021, 3:41 PMbind<Fragment>() from provider { context }
would cause the same issue with the linter