{"id":22221906,"url":"https://github.com/fabiospampinato/dettle","last_synced_at":"2025-10-25T06:03:24.931Z","repository":{"id":65533710,"uuid":"594183940","full_name":"fabiospampinato/dettle","owner":"fabiospampinato","description":"A tiny fully-featured debounce and throttle implementation.","archived":false,"fork":false,"pushed_at":"2025-01-26T23:38:10.000Z","size":16,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T12:05:56.526Z","etag":null,"topics":["debounce","throttle","tiny"],"latest_commit_sha":null,"homepage":"","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/fabiospampinato.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"fabiospampinato","custom":"https://www.paypal.me/fabiospampinato"}},"created_at":"2023-01-27T19:51:29.000Z","updated_at":"2025-01-26T23:38:13.000Z","dependencies_parsed_at":"2024-04-04T23:30:25.735Z","dependency_job_id":"b5352a01-0a62-4de0-8777-9b6cc445c083","html_url":"https://github.com/fabiospampinato/dettle","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"a74f4489eb53b264f895840f3c0351f8a86271c7"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fdettle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fdettle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fdettle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fdettle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiospampinato","download_url":"https://codeload.github.com/fabiospampinato/dettle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245755674,"owners_count":20667027,"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":["debounce","throttle","tiny"],"created_at":"2024-12-02T23:16:07.830Z","updated_at":"2025-10-25T06:03:19.882Z","avatar_url":"https://github.com/fabiospampinato.png","language":"TypeScript","funding_links":["https://github.com/sponsors/fabiospampinato","https://www.paypal.me/fabiospampinato"],"categories":[],"sub_categories":[],"readme":"# Dettle\n\nA tiny fully-featured debounce and throttle implementation.\n\n## Install\n\n```sh\nnpm install dettle\n```\n\n## Usage\n\n```ts\nimport {debounce, throttle} from 'dettle';\n\nconst fn = () =\u003e console.log ( 'Fired!' );\n\n// Debouncing\n// The following options are supported:\n// `leading`: whether the function should be called when the timeout is created, defaults to `false`\n// `trailing`: whether the function should be called when the timeout expires, defaults to `true`\n// `maxWait`: the maximum amount of time that can pass before the function is called, defaults to `Infinity`\n\nconst debounced = debounce ( fn, 1000, {\n  leading: false,\n  trailing: true,\n  maxWait: Infinity\n});\n\ndebounced (); // Schedule function for execution\ndebounced (); // Re-schedule function for execution\n\ndebounced.flush (); // Execute the function immediately, if there's a scheduled execution\ndebounced.cancel (); // Cancel the scheduled execution\n\n// Throttling\n// The API for throttling is basically the same, except that:\n// - `leading`: is `true` by default rather than `false`\n// - `maxWait`: is set implicitly for you to be equal to the wait time\n\nconst throttled = throttle ( fn, 1000, {\n  leading: true,\n  trailing: true\n});\n\nthrottled (); // Call the function immediately\nthrottled (); // Schedule function for execution\n\nthrottled.flush (); // Execute the function immediately, if there's a scheduled execution\nthrottled.cancel (); // Cancel the scheduled execution\n```\n\n## License\n\nMIT © Fabio Spampinato\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fdettle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiospampinato%2Fdettle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fdettle/lists"}