rememberInject
Inject an instance with resolved dependencies
@Composable
fun Sample(
controller: SampleController = rememberInject()
) {
/* ... */
}
Content copied to clipboard
Parameters
qualifier
Qualifier for identification. Specify the instantiation of the annotation with Qualifier.
inline fun <T : Any> rememberInject(qualifier: Any? = null, componentExtras: ComponentExtras<*>?): T
Inject an instance with resolved dependencies (experimental)
@Composable
fun Sample(
controller: SampleController = rememberInject()
) {
/* ... */
}
Content copied to clipboard
Parameters
qualifier
Qualifier for identification. Specify the instantiation of the annotation with Qualifier.
componentExtras
Specify ComponentExtras to create Component.
Deprecated
The method of specifying qualifier has been unified.
Replace with
import com.moriatsushi.koject.Named
Content copied to clipboard
rememberInject(Named(name))
Content copied to clipboard
Inject an Named instance with resolved dependencies
Parameters
name
name of Named
Deprecated
The method of specifying qualifier has been unified.
Replace with
import com.moriatsushi.koject.Named
Content copied to clipboard
rememberInject(Named(name), componentExtras)
Content copied to clipboard
Inject an Named instance with resolved dependencies (experimental)
Parameters
name
name of Named
componentExtras
Specify ComponentExtras to create Component.