All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.arkivanov.mvikotlin.rx.internal.DisposableBuilder.kt Maven / Gradle / Ivy

The newest version!
package com.arkivanov.mvikotlin.rx.internal

import com.arkivanov.mvikotlin.rx.Disposable
import kotlin.concurrent.Volatile

fun Disposable(onDispose: Disposable.() -> Unit = {}): Disposable =
    object : Disposable {
        @Volatile
        override var isDisposed: Boolean = false

        override fun dispose() {
            isDisposed = true
            onDispose()
        }
    }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy