. We going to set value in localStorage with the ttl and this package will check and then remove it for us, we don't need any extra checks.
Here is an example of vanillaJS implementation
**index.html**
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Test localstorage-slim</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="../favicon.ico" />
<link rel="stylesheet" href="./css/main.css" type="text/css">
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/localstorage-slim"></script>
<script src="./js/main.js">
</script>
</body>
</html>
**main.js**
ls.set(localStorageKey, JSON.stringify(ticketFieldsDropDownData), {
ttl: 604800,
}); //one week in seconds
SOCIAL SHARE CARD GENERATOR