{"id":13565725,"url":"https://github.com/siddharthkp/use-timeout","last_synced_at":"2025-09-08T09:31:36.732Z","repository":{"id":47407477,"uuid":"169054516","full_name":"siddharthkp/use-timeout","owner":"siddharthkp","description":"Declarative React hook for setTimeout","archived":false,"fork":false,"pushed_at":"2023-01-04T02:17:19.000Z","size":225,"stargazers_count":75,"open_issues_count":9,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-28T02:04:44.574Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://codesandbox.io/s/vqxwwyolxy","language":"JavaScript","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/siddharthkp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-04T09:26:52.000Z","updated_at":"2024-01-20T15:07:40.000Z","dependencies_parsed_at":"2023-02-01T17:46:42.741Z","dependency_job_id":null,"html_url":"https://github.com/siddharthkp/use-timeout","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddharthkp%2Fuse-timeout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddharthkp%2Fuse-timeout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddharthkp%2Fuse-timeout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddharthkp%2Fuse-timeout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siddharthkp","download_url":"https://codeload.github.com/siddharthkp/use-timeout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232296903,"owners_count":18501331,"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-01T13:01:54.002Z","updated_at":"2025-01-03T05:47:28.489Z","avatar_url":"https://github.com/siddharthkp.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://pbs.twimg.com/media/DyKPpD7UwAAVKyH.jpg\" height=\"200px\"/\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003cb\u003eDeclarative React hook for setTimeout\u003c/b\u003e\n  \u003cbr\u003e\u003cbr/\u003e\n  \u003ca href=\"https://codesandbox.io/s/vqxwwyolxy\"\u003eDemo on CodeSandbox\u003c/a\u003e\n\u003c/p\u003e\n\n\u0026nbsp;\n\nDeclarative adaptation of `setTimeout` based on [Dan Abramov's blog post](https://overreacted.io/making-setinterval-declarative-with-react-hooks/) about `setInterval`\n\n#### install\n\n```\nnpm install use-timeout\n```\n\n\u0026nbsp;\n\n#### usage\n\n```js\nimport useTimeout from 'use-timeout'\n\nfunction SimpleExample() {\n  const [message, setMessage] = useState('changing in 2 seconds...')\n\n  useTimeout(() =\u003e setMessage('changed!'), 2000)\n\n  return \u003cdiv\u003e{message}\u003c/div\u003e\n}\n```\n\n\u0026nbsp;\n\n#### but why?\n\nLong answer long: [overreacted.io/making-setinterval-declarative-with-react-hooks/](https://overreacted.io/making-setinterval-declarative-with-react-hooks/)\n\n#### like it?\n\n:star: this repo\n\n\u0026nbsp;\n\n#### license\n\nMIT © [siddharthkp](https://github.com/siddharthkp)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddharthkp%2Fuse-timeout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiddharthkp%2Fuse-timeout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddharthkp%2Fuse-timeout/lists"}