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
Copy file name to clipboardExpand all lines: docs/reference/koin-compose/compose.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,6 +124,53 @@ You can use parameters with lambda injection like `koinInject<MyService>{ parame
124
124
From version 4.0.2 of Koin, koinInject(Qualifier,Scope,ParametersHolder) is introduced to let you use parameters in the most efficient way
125
125
:::
126
126
127
+
### Injecting from Activity Scope - koinActivityInject (Android only)
128
+
129
+
:::info
130
+
This is an **Android-only** feature available in `koin-compose` starting from version 4.2.0.
131
+
:::
132
+
133
+
The `koinActivityInject()` function allows you to resolve dependencies scoped to the current Activity from within a Composable. This is useful when you need to share state or dependencies across multiple Composables within the same Activity.
134
+
135
+
**Requirements:**
136
+
- Your Activity must implement `AndroidScopeComponent` to provide its Koin scope
137
+
- The dependency must be declared in an Activity scope
0 commit comments