1.0.0 • Published 8 years ago

meanie-angular-debounce v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

meanie-angular-debounce

npm version node dependencies github issues codacy

A simple Angular service for debouncing function calls

Meanie

Installation

You can install this package using yarn or npm:

#yarn
yarn add meanie-angular-debounce

#npm
npm install meanie-angular-debounce --save

Include the script node_modules/meanie-angular-debounce/release/meanie-angular-debounce.js in your build process, or add it via a <script> tag to your index.html:

<script src="node_modules/meanie-angular-debounce/release/meanie-angular-debounce.js"></script>

Add Debounce.Service as a dependency for your app.

Usage

Include the $debounce service in your controller or component:

angular.module('App.MyModule').controller('MyController', function($debounce) => {

  function someFunction() {
    console.log('I am debounced');
  }

  //Debounce
  $debounce(someFunction, 1000);
});

The $debounce service returns a promise which will be resolved with the return value of the debounced function once the underlying timeout resolves.

Issues & feature requests

Please report any bugs, issues, suggestions and feature requests in the meanie-angular-debounce issue tracker.

Contributing

Pull requests are welcome! If you would like to contribute to Meanie, please check out the Meanie contributing guidelines.

Credits

License

(MIT License)

Copyright 2015-2017, Adam Reis

1.0.0

8 years ago