Skip to content

useLockCallback

Hook that prevents a callback from being executed multiple times simultaneously

async
medium
test coverage
Last changed: 7 months ago

Installation

Library
CLI
Manual
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

SourceDemo

Contributors

D
debabin
debabin

Released under the MIT License.