import {ref} from "vue";

const loading = ref(0)

export default function useLoading() {

    function load_start() {
        loading.value++
    }

    function load_done() {
        loading.value--
        if(loading.value < 0) {
            loading.value = 0;
        }
    }

    return {loading, load_start, load_done}
}
