UNPKG

343 BTypeScriptView Raw
1/**
2 * Locker return cached mark.
3 * If set to `true`, will return `true` in a short time even if set `false`.
4 * If set to `false` and then set to `true`, will change to `true`.
5 * And after time duration, it will back to `null` automatically.
6 */
7export default function useLock(duration?: number): [() => boolean, (lock: boolean) => void];