{"id":13809010,"url":"https://github.com/loreanvictor/audit-debounce","last_synced_at":"2026-04-19T21:02:36.667Z","repository":{"id":213490524,"uuid":"734256083","full_name":"loreanvictor/audit-debounce","owner":"loreanvictor","description":"Rxjs operator to debounce and audit simultaenously","archived":false,"fork":false,"pushed_at":"2024-01-08T06:38:45.000Z","size":161,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-24T08:02:55.406Z","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/loreanvictor.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}},"created_at":"2023-12-21T08:37:32.000Z","updated_at":"2023-12-21T09:30:56.000Z","dependencies_parsed_at":"2023-12-21T10:30:41.173Z","dependency_job_id":"a19ef61e-e893-49e3-a01f-c9c039253e2c","html_url":"https://github.com/loreanvictor/audit-debounce","commit_stats":null,"previous_names":["loreanvictor/audit-debounce"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loreanvictor%2Faudit-debounce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loreanvictor%2Faudit-debounce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loreanvictor%2Faudit-debounce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loreanvictor%2Faudit-debounce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loreanvictor","download_url":"https://codeload.github.com/loreanvictor/audit-debounce/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243148691,"owners_count":20244031,"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-04T01:01:57.642Z","updated_at":"2025-12-24T21:30:02.981Z","avatar_url":"https://github.com/loreanvictor.png","language":"TypeScript","funding_links":[],"categories":["Table of contents"],"sub_categories":["Third Party Components"],"readme":"\u003cdiv align=\"right\"\u003e\n\n[![npm package minimized gzipped size](https://img.shields.io/bundlephobia/minzip/audit-debounce?style=flat-square\u0026label=%20\u0026color=black)](https://bundlejs.com/?q=audit-debounce)\n[![npm](https://img.shields.io/npm/v/audit-debounce?color=black\u0026label=\u0026style=flat-square)](https://www.npmjs.com/package/audit-debounce)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/loreanvictor/audit-debounce/coverage.yml?label=\u0026style=flat-square)](https://github.com/loreanvictor/audit-debounce/actions/workflows/coverage.yml)\n\n\u003c/div\u003e\n\n# audit-debounce\n\n[RxJS](https://rxjs.dev) operator to debounce and audit simultaenously. When you [`debounce()`](https://rxjs.dev/api/operators/debounce) a particularly active observable, you might have to wait a long\ntime to get any value from it (if it is constantly emitting values). `auditDebounce()` solves this problem by\ndebouncing the observable, but also emitting the latest value after a given duration has passed.\n\n```js\nimport { auditDebounceTime } from 'audit-debounce'\n\nsource$.pipe(\n  // debounce for 100ms, but also emit the latest value after 1000ms\n  auditDebounceTime(100, 1000)\n)\n```\n```js\nimport { timer } from 'rxjs'\nimport { auditDebounce } from 'audit-debounce'\n\nsource$.pipe(\n  // debounce for 100ms, but also emit the latest value after 1000ms\n  auditDebounce(\n    () =\u003e timer(100),\n    () =\u003e timer(1000)\n  )\n)\n```\n\n\u003cdiv align=\"right\"\u003e\n  \n[▶ TRY IT](https://codepen.io/lorean_victor/pen/jOJqdNv?editors=0010)\n  \n\u003c/div\u003e\n\n\u003cbr\u003e\n\n# Contents\n\n- [Contents](#contents)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Contribution](#contribution)\n\n\u003cbr\u003e\n\n# Installation\n\n[Node](https://nodejs.org/en/):\n\n```bash\nnpm i audit-debounce\n```\n\nBrowser / [Deno](https://deno.land):\n\n```js\nimport { auditDebounceTime } from 'https://esm.sh/audit-debounce'\n```\n\n\u003cbr\u003e\n\n# Usage\n\nThis package provides the following functions:\n\n```ts\nfunction auditDebounceTime\u003cT\u003e(\n  debounceTime: number,\n  auditTime: number,\n  scheduler?: SchedulerLike\n): MonoTypeOperatorFunction\u003cT\u003e\n```\n```ts\nfunction auditDebounce\u003cT\u003e(\n  debounceSelector: (value: T | typeof CANCEL_SIGNAL) =\u003e ObservableInput\u003cany\u003e,\n  auditSelector: (value: T | typeof CANCEL_SIGNAL) =\u003e ObservableInput\u003cany\u003e\n): MonoTypeOperatorFunction\u003cT\u003e\n```\n\nThe operator will debounce incoming values, but also makes sure values are emitted after certain duration\nis passed.\n\n```\nsource$:           --a-b------c-d-e-f------h-i-j-k-l-----\u003e\ndebounceSelector$:   -----x   ---------x   -----------x\nauditSelector$:      -------y -------y     -------y\nresult$:           -------b----------f------------k---l--\u003e\n```\n\n\u003cbr\u003e\n\n# Contribution\n\nYou need [node](https://nodejs.org/en/), [NPM](https://www.npmjs.com) to start and [git](https://git-scm.com) to start.\n\n```bash\n# clone the code\ngit clone git@github.com:loreanvictor/audit-debounce.git\n```\n```bash\n# install stuff\nnpm i\n```\n\nMake sure all checks are successful on your PRs. This includes all tests passing, high code coverage, correct typings and abiding all [the linting rules](https://github.com/loreanvictor/audit-debounce/blob/main/.eslintrc). The code is typed with [TypeScript](https://www.typescriptlang.org), [Jest](https://jestjs.io) is used for testing and coverage reports, [ESLint](https://eslint.org) and [TypeScript ESLint](https://typescript-eslint.io) are used for linting. Subsequently, IDE integrations for TypeScript and ESLint would make your life much easier (for example, [VSCode](https://code.visualstudio.com) supports TypeScript out of the box and has [this nice ESLint plugin](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)), but you could also use the following commands:\n\n```bash\n# run tests\nnpm test\n```\n```bash\n# check code coverage\nnpm run coverage\n```\n```bash\n# run linter\nnpm run lint\n```\n```bash\n# run type checker\nnpm run typecheck\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floreanvictor%2Faudit-debounce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floreanvictor%2Faudit-debounce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floreanvictor%2Faudit-debounce/lists"}