package com.grkj.iscs.extentions

import android.view.View

fun View.debounce(
    debounceTime: Long = 1500L,
    onClick: () -> Unit
) {
    var lastClickTime = 0L
    setOnClickListener {
        val currentTime = System.currentTimeMillis()
        if (currentTime - lastClickTime >= debounceTime) {
            onClick()
        }
        lastClickTime = currentTime
    }
}