Skip to content

Commit

Permalink
Merge pull request #35 from dhershman1/development
Browse files Browse the repository at this point in the history
Fixed unclear documentation
  • Loading branch information
dhershman1 authored Mar 31, 2020
2 parents 57b774b + a5e1b63 commit 74c7bcb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## v2.5.3

### Fixed

- Unclear documentation on using the `debounce` function [#34](https://github.com/dhershman1/vue-debounce/issues/34)

## v2.5.2

### Improved
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,14 @@ Simply require the debounce file.
import { debounce } from 'vue-debounce'
```

And then you can use it as a function like so:
The `debounce` function returns a function back which in turn is debounced, so you can set them up ahead of time, or just double call the function like so:

```js
debounce(() => console.log('normal format'), '400ms')
const dFn = debounce(val => console.log('normal format', val), '400ms')

dFn(10) // => 'normal format' 10
// Or
debounce(() => console.log('just a number!'), 400)
debounce(val => console.log('just a number!'), 400)(10) // => 'just a number!' 10
```

## Typescript Support
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-debounce",
"version": "2.5.2",
"version": "2.5.3",
"description": "A simple vue directive for debounce",
"main": "dist/vue-debounce.min.js",
"types": "types/index.d.ts",
Expand Down

0 comments on commit 74c7bcb

Please sign in to comment.