Skip to content

Commit 841c0d7

Browse files
committed
OptIn to ExperimentalNativeApi
1 parent 188b7be commit 841c0d7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

kmm-viewmodel-core/src/appleMain/kotlin/com/rickclephas/kmm/viewmodel/KMMViewModel.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.rickclephas.kmm.viewmodel
22

33
import kotlinx.coroutines.CoroutineScope
4+
import kotlin.experimental.ExperimentalNativeApi
45
import 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

kmm-viewmodel-core/src/appleMain/kotlin/com/rickclephas/kmm/viewmodel/ViewModelScope.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import kotlinx.coroutines.flow.StateFlow
1010
import kotlinx.coroutines.flow.asStateFlow
1111
import kotlinx.coroutines.flow.update
1212
import platform.darwin.NSObject
13+
import kotlin.experimental.ExperimentalNativeApi
1314
import 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
3739
public class ViewModelScopeImpl internal constructor(
3840
private val viewModelRef: WeakReference<KMMViewModel>

0 commit comments

Comments
 (0)