Skip to content

useLastChanged

Hook for records the timestamp of the last change

utilities
low
test coverage
Last changed: 7 months ago

Installation

Library
CLI
Manual
typescript
import { useLastChanged } from '@siberiacancode/reactuse';

Usage

typescript
const lastChanged = useLastChanged(source);

Demo

Api

Parameters

NameTypeDefaultNote
sourceany-The source of the last change
options.initialValue?number | nullnullThe initial value

Returns

number | null

Type declaration

typescript
export interface UseLastChangedOptions {
  initialValue?: number;
}

Source

SourceDemo

Contributors

D
debabin
debabin
V
VLADISLAW9
VLADISLAW9

Released under the MIT License.