Search...
A React Hook that record the last updated time of a state.
See API for more details.
Click links below to view source on GitHub.
const lastUpdated = useLastUpdated(source, options)
Any state that you want to record the last updated time.
export type UseLastChangedOptions = { /** * The initial value of the last updated timestamp. * * @defaultValue null */ initialValue?: number | null /** * If `true`, deep compares the source object. * * @defaultValue false */ deep?: boolean }
number | null.
number | null
When the source is updated, the number will be updated to the current timestamp, otherwise it will be null (e.g. the source is NOT updated).
null