utility-functions-js

0.0.6 • Public • Published

Utility functions

A list of utility functions

  • debounce

The debounce function takes two arguments

- A callback function
- Timeout

You can import the package or this is made available globally you can use that.
The below example shows debouncing the user key input. The onInput method will only
get call if the user takes one second pause. This way you minimize the number of function execution.
    import debounce from 'https://unpkg.com/utility-functions-js@latest/functions/debounce.js'

    function onInput () {
      debounce(() => alert('Hello world'), 1000)
    }

Package Sidebar

Install

npm i utility-functions-js

Weekly Downloads

2

Version

0.0.6

License

MIT

Unpacked Size

2.05 kB

Total Files

6

Last publish

Collaborators

  • skumarbinay