ProductPromotion
Logo

Angular.JS

made by https://0x3d.site

GitHub - loreanvictor/audit-debounce: Rxjs operator to debounce and audit simultaenously
Rxjs operator to debounce and audit simultaenously - loreanvictor/audit-debounce
Visit Site

GitHub - loreanvictor/audit-debounce: Rxjs operator to debounce and audit simultaenously

GitHub - loreanvictor/audit-debounce: Rxjs operator to debounce and audit simultaenously

npm package minimized gzipped size npm GitHub Workflow Status

audit-debounce

RxJS operator to debounce and audit simultaenously. When you debounce() a particularly active observable, you might have to wait a long time to get any value from it (if it is constantly emitting values). auditDebounce() solves this problem by debouncing the observable, but also emitting the latest value after a given duration has passed.

import { auditDebounceTime } from 'audit-debounce'

source$.pipe(
  // debounce for 100ms, but also emit the latest value after 1000ms
  auditDebounceTime(100, 1000)
)
import { timer } from 'rxjs'
import { auditDebounce } from 'audit-debounce'

source$.pipe(
  // debounce for 100ms, but also emit the latest value after 1000ms
  auditDebounce(
    () => timer(100),
    () => timer(1000)
  )
)

▶ TRY IT

Contents

Installation

Node:

npm i audit-debounce

Browser / Deno:

import { auditDebounceTime } from 'https://esm.sh/audit-debounce'

Usage

This package provides the following functions:

function auditDebounceTime<T>(
  debounceTime: number,
  auditTime: number,
  scheduler?: SchedulerLike
): MonoTypeOperatorFunction<T>
function auditDebounce<T>(
  debounceSelector: (value: T | typeof CANCEL_SIGNAL) => ObservableInput<any>,
  auditSelector: (value: T | typeof CANCEL_SIGNAL) => ObservableInput<any>
): MonoTypeOperatorFunction<T>

The operator will debounce incoming values, but also makes sure values are emitted after certain duration is passed.

source$:           --a-b------c-d-e-f------h-i-j-k-l----->
debounceSelector$:   -----x   ---------x   -----------x
auditSelector$:      -------y -------y     -------y
result$:           -------b----------f------------k---l-->

Contribution

You need node, NPM to start and git to start.

# clone the code
git clone [email protected]:loreanvictor/audit-debounce.git
# install stuff
npm i

Make sure all checks are successful on your PRs. This includes all tests passing, high code coverage, correct typings and abiding all the linting rules. The code is typed with TypeScript, Jest is used for testing and coverage reports, ESLint and TypeScript ESLint are used for linting. Subsequently, IDE integrations for TypeScript and ESLint would make your life much easier (for example, VSCode supports TypeScript out of the box and has this nice ESLint plugin), but you could also use the following commands:

# run tests
npm test
# check code coverage
npm run coverage
# run linter
npm run lint
# run type checker
npm run typecheck

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory