Skip to content

useLockCallback ​

utilities
test coverage
Last changed: 15 days ago

Hook that prevents a callback from being executed multiple times simultaneously

typescript
import { useLockCallback } from '@siberiacancode/reactuse';

Usage ​

typescript
const lockedCallback = useLockCallback(() => promise());

Demo ​

Api ​

Parameters

NameTypeDefaultNote
callbackFunction-The callback to be locked

Returns

Function

Source ​

Source • Demo

Contributors ​

Avatardebabin

Released under the MIT License.