Skip to main content

Install

npm

Description

The useLocalStorageWithExpiry hook allows you to store data in the browser’s localStorage with an expiration time. This is useful when you need to cache data temporarily and want it to be automatically removed after a certain period. The hook manages the storage and retrieval of data, ensuring that expired data is not used.

Parameters

Return Values

Example

useLocalStorageWithExpiry.example.tsx