# ng-debottle

> Angular debounce/throttle portmanteau, now with $timeout flavour

Latest version **1.1.0** (published 2015-12-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install ng-debottle
pnpm add ng-debottle
yarn add ng-debottle
bun add ng-debottle
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2015-12-24 |
| First published | 2015-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4.0.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | ex-machine |
| Maintainers | ex-machine |
| Keywords | angular, debounce, throttle |

## Links

- npm: https://www.npmjs.com/package/ng-debottle
- Repository: https://github.com/ex-machine/ng-debottle
- Homepage: https://github.com/ex-machine/ng-debottle#readme
- Issues: https://github.com/ex-machine/ng-debottle/issues
- npm.io page: https://npm.io/package/ng-debottle

## Dependencies (2)

- [apply-fn](https://npm.io/package/apply-fn.md) ^1.0.3
- [debottle](https://npm.io/package/debottle.md) ^1.0.1

## Recent versions

- 1.1.0 (latest) — 2015-12-24
- 1.0.3 — 2015-11-03
- 1.0.2 — 2015-11-02
- 1.0.1 — 2015-11-01

## README

# ng-debottle

Angular debounce/throttle portmanteau, now with $timeout flavour.

Wraps [`debottle`](https://github.com/ex-machine/debottle) package to provide generic JS `debounce` and `throttle` as Angular services.

## Install

### NPM

    npm install --save ng-debottle

### Bower

    bower install --save ng-debottle

## Usage

```javascript
angular.module('app', ['ngDebottle'])
.run(function ($rootScope, $throttle, $debounce) {
	function fn() { ... }
	var throttledFn = $throttle(fn, 100);
	var debouncedFn = $debounce(fn, 100);

	// based on $timeout, synced to digest cycles 
	$rootScope.$on('...', throttledFn);
	$rootScope.$on('...', debouncedFn );
	// instead of
	$rootScope.$on('...', fn);
})
.run(function ($rootElement, throttle, debounce) {
	function fn() { ... }
	var throttledFn = throttle(fn, 20);
	var debouncedFn = debounce(fn, 20);

	// based on setTimeout, not synced to digest cycles
	$rootElement.on('...', throttledFn);
	$rootElement.on('...', debouncedFn);
	// instead of
	$rootElement.on('...', fn);
});
```

---
_Source: https://npm.io/package/ng-debottle · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
