{"id":13735649,"url":"https://github.com/MacFJA/svelte-expirable","last_synced_at":"2025-05-08T12:30:46.395Z","repository":{"id":143759015,"uuid":"434383494","full_name":"MacFJA/svelte-expirable","owner":"MacFJA","description":"A Svelte store with items that expire","archived":false,"fork":false,"pushed_at":"2021-12-03T20:12:10.000Z","size":17,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-24T20:06:49.259Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MacFJA.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-02T21:43:19.000Z","updated_at":"2024-02-07T05:34:11.000Z","dependencies_parsed_at":"2023-08-09T19:17:52.770Z","dependency_job_id":null,"html_url":"https://github.com/MacFJA/svelte-expirable","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacFJA%2Fsvelte-expirable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacFJA%2Fsvelte-expirable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacFJA%2Fsvelte-expirable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacFJA%2Fsvelte-expirable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MacFJA","download_url":"https://codeload.github.com/MacFJA/svelte-expirable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252551644,"owners_count":21766581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T03:01:09.303Z","updated_at":"2025-05-08T12:30:46.125Z","avatar_url":"https://github.com/MacFJA.png","language":"TypeScript","funding_links":[],"categories":["Time"],"sub_categories":[],"readme":"# Svelte Expirable store\n\nA Svelte store with items that expire\n\n## Installation\n\n```\nnpm install @macfja/svelte-expirable\n```\n\n## Usage\n\n`notification.js`\n```javascript\nimport { expirable } from \"@macfja/svelte-expirable\"\n\nexport const notifications = expirable()\n```\n\n`App.svelte`\n```html\n\u003cscript\u003e\n    import { notifications } from './notifications.js'\n    \n    const onClickHandler = () =\u003e {\n        // Do some action\n        notifications.push('Data saved', 2) // Message expire after 2 seconds\n    }\n\u003c/script\u003e\n\n\u003cheader\u003e\n    {#each $notifications as {data, id, repeated} (id)}\n        \u003cdiv class=\"message\"\u003e{data}{#if repeated \u003e 0} (x{repeated + 1}){/if}\u003c/div\u003e\n    {/each}\n\u003c/header\u003e\n```\n\nWhen the same data is push to the store, the expiration time is reset to the new TTL, and the `repeated` variable is incremented\n\n## Contributing\n\nContributions are welcome. Please open up an issue or create PR if you would like to help out.\n\nRead more in the [Contributing file](CONTRIBUTING.md)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMacFJA%2Fsvelte-expirable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMacFJA%2Fsvelte-expirable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMacFJA%2Fsvelte-expirable/lists"}