2.0.1 • Published 11 months ago
ajanuw-event-mutex v2.0.1
event mutex
import { EventMutex } from 'ajanuw-event-mutex';
const m = new EventMutex((e) => {
console.log(e);
});
document.querySelector("#btn").addEventListener("click", () => m.listener());
vue
<template>
<button type="button" @click="submitMutex.listener($event)">CLICK</button>
<button type="button" @click="submitMutex.unlock()">UNLOCK</button>
<view> {{ submitMutex.isLock }} </view>
</template>
<script setup>
import { reactive } from "vue"
import { EventMutex } from 'ajanuw-event-mutex';
const submitMutex = reactive(new EventMutex((e) => {
console.log(e);
}, false));
</script>
build
$ npm run build