File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
kmm-viewmodel-core/src/appleMain/kotlin/com/rickclephas/kmm/viewmodel Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change 11package com.rickclephas.kmm.viewmodel
22
33import kotlinx.coroutines.CoroutineScope
4+ import kotlin.experimental.ExperimentalNativeApi
45import kotlin.native.ref.WeakReference
56
67/* *
@@ -16,6 +17,7 @@ public actual abstract class KMMViewModel {
1617 * On Android this is bound to `Dispatchers.Main.immediate`,
1718 * where on Apple platforms it is bound to `Dispatchers.Main`.
1819 */
20+ @OptIn(ExperimentalNativeApi ::class )
1921 @Suppress(" LeakingThis" )
2022 public actual val viewModelScope: ViewModelScope = ViewModelScopeImpl (WeakReference (this ))
2123
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import kotlinx.coroutines.flow.StateFlow
1010import kotlinx.coroutines.flow.asStateFlow
1111import kotlinx.coroutines.flow.update
1212import platform.darwin.NSObject
13+ import kotlin.experimental.ExperimentalNativeApi
1314import kotlin.native.ref.WeakReference
1415
1516/* *
@@ -33,6 +34,7 @@ public inline fun ViewModelScope.asImpl(): ViewModelScopeImpl = this as ViewMode
3334/* *
3435 * Implementation of [ViewModelScope].
3536 */
37+ @OptIn(ExperimentalNativeApi ::class )
3638@InternalKMMViewModelApi
3739public class ViewModelScopeImpl internal constructor(
3840 private val viewModelRef : WeakReference <KMMViewModel >
You can’t perform that action at this time.
0 commit comments