Skip to content

useLastChanged ​

Hook for records the timestamp of the last change

time
test coverage
Last changed: last month

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 ​

Source • Demo

Contributors ​

D
debabin
debabin
V
VLADISLAW9
VLADISLAW9

Released under the MIT License.