LazyBind
A delegate class that implements ScopeComponent to provide a late-initialized scope. It acts as a placeholder for a Scope that will be injected later in the component's lifecycle. This is particularly useful in Android where context-dependent scopes cannot be created at property initialization time.
Usage (for Android):
class MyActivity : AppCompatActivity(), ScopeComponent<MyScope> by LazyBind() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
injectScope(lazy { createMyScope() })
// Now you can access scope.value
}
}Content copied to clipboard
Parameters
T
The type of the Scope being delegated.
Properties
Functions
Link copied to clipboard
Injects the actual Scope instance into the component. This method is designed to be called during the component's initialization phase (e.g., Activity.onCreate).
Link copied to clipboard
Checks if the scope has been injected and initialized.