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

commonMain.tech.skot.core.components.SKLoader.kt Maven / Gradle / Ivy

There is a newer version: 1.2.9
Show newest version
package tech.skot.core.components

import tech.skot.core.di.coreViewInjector

class SKLoader : SKComponent() {

    override val view = coreViewInjector.loader()

    fun workStarted() {
        loadingCounter++
    }

    fun workEnded() {
        loadingCounter--
    }

    fun isLoading():Boolean = loadingCounter > 0
    fun isNotLoading():Boolean = !isLoading()

    private var loadingCounter = 0
        set(value) {
            field = value
            view.visible = value > 0
        }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy