{"id":17347603,"url":"https://github.com/vicary/debounce-microtask","last_synced_at":"2026-03-03T04:13:29.739Z","repository":{"id":238788783,"uuid":"797539223","full_name":"vicary/debounce-microtask","owner":"vicary","description":"A TypeScript implementation of debounce with microtasks instead of timeout.","archived":false,"fork":false,"pushed_at":"2024-08-20T10:22:27.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-24T17:57:33.611Z","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/vicary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":["vicary"]}},"created_at":"2024-05-08T03:20:30.000Z","updated_at":"2024-08-20T10:22:31.000Z","dependencies_parsed_at":"2024-05-08T06:25:22.431Z","dependency_job_id":"1cb5130d-492e-4241-9728-0035225b2cce","html_url":"https://github.com/vicary/debounce-microtask","commit_stats":null,"previous_names":["vicary/debounce-microtask"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vicary/debounce-microtask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicary%2Fdebounce-microtask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicary%2Fdebounce-microtask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicary%2Fdebounce-microtask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicary%2Fdebounce-microtask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vicary","download_url":"https://codeload.github.com/vicary/debounce-microtask/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vicary%2Fdebounce-microtask/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30031981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T03:27:35.548Z","status":"ssl_error","status_checked_at":"2026-03-03T03:27:09.213Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-10-15T16:49:25.774Z","updated_at":"2026-03-03T04:13:29.724Z","avatar_url":"https://github.com/vicary.png","language":"TypeScript","funding_links":["https://github.com/sponsors/vicary"],"categories":[],"sub_categories":[],"readme":"# DebounceMicrotask\n\nDebounce a function using microtasks instead of timers.\n\n## Usage\n\n```typescript\nimport { debounceMicrotask } from \"@vicary/debounce-microtask\";\n\nconst debounced = debounceMicrotask((text: string) =\u003e {\n  console.log(\"debounced\", text);\n});\n\ndebounced(\"a\");\ndebounced(\"b\");\ndebounced(\"c\");\n\nawait Promise.resolve();\n\n// Prints \"debounced a\"\n```\n\n### Options\n\n#### debounceLimit\n\nThrows when the specified limit is reached before the function is run, this is a\nsafety measure preventing recursive debounces. You may disable it with\n`Infinity`.\n\nDefaults to 1000.\n\n```typescript\nimport { debounceMicrotask } from \"@vicary/debounce-microtask\";\n\nconst debounced = debounceMicrotask(\n  (text: string) =\u003e {\n    console.log(\"debounced\", text);\n  },\n  { debounceLimit: 1 },\n);\n\ndebounced(\"a\");\n\ndebounced(\"b\"); // Throws\n```\n\n### limitAction\n\nSpecifies the action to take when the debounce limit is reached.\n\nPossible values are `throw`, `ignore`, and `invoke`.\n\nDefaults to `throw`.\n\n```typescript\nimport { debounceMicrotask } from \"@vicary/debounce-microtask\";\n\nconst debounced = debounceMicrotask(\n  (text: string) =\u003e {\n    console.log(\"debounced\", text);\n  },\n  { limitAction: \"throw\" },\n);\n\ndebounced(\"a\");\n\ndebounced(\"b\"); // Throws\n```\n\n### updateArguments\n\nUpdates the calling arguments to the latest invocation.\n\nDefaults to `false`.\n\n```typescript\nimport { debounceMicrotask } from \"@vicary/debounce-microtask\";\n\nconst debounced = debounceMicrotask(\n  (text: string) =\u003e {\n    console.log(\"debounced\", text);\n  },\n  { updateArguments: true },\n);\n\ndebounced(\"a\");\ndebounced(\"b\");\ndebounced(\"c\");\n\nawait Promise.resolve();\n\n// Prints \"debounced c\"\n```\n\n### promise\n\nReturns a promisified debounce function, the promise resolves when the specified\nfunction is called.\n\n```typescript\nimport { debounceMicrotask } from \"@vicary/debounce-microtask/promise\";\n\nconst debounced = debounceMicrotask(\n  (text: string) =\u003e {\n    console.log(\"debounced\", text);\n  },\n  {\n    updateArguments: true,\n  },\n);\n\nawait Promise.all([\n  debounced(\"a\"),\n  debounced(\"b\"),\n  debounced(\"c\"),\n]);\n\n// Only prints \"debounced c\"\n```\n\n## Contributing\n\nIf you find a bug or would like to suggest a new feature, please open an issue\nor submit a pull request on GitHub.\n\n## License\n\nDebounceMicrotask is licensed under the MIT License. See the LICENSE file for\nmore information.\n\n## Funding\n\nIf you find this project useful, please consider supporting it by donating to\nthe author.\n\n[![Donate](https://img.shields.io/static/v1?label=Sponsor\u0026message=%E2%9D%A4\u0026logo=GitHub)](https://github.com/sponsors/vicary)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvicary%2Fdebounce-microtask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvicary%2Fdebounce-microtask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvicary%2Fdebounce-microtask/lists"}