Skip to content

Commit

Permalink
fix doc example
Browse files Browse the repository at this point in the history
  • Loading branch information
dormeiri committed Dec 6, 2023
1 parent 74ca117 commit d9c04ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export type Options = {
const throttle = pThrottle({
limit: 2,
interval: 1000,
onDelay: () => console.log('Reached interval limit, call is delayed'),
onDelay: () => {
console.log('Reached interval limit, call is delayed');
},
});
const throttled = throttle(() => console.log('Executing...'));
Expand Down
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ import pThrottle from 'p-throttle';
const throttle = pThrottle({
limit: 2,
interval: 1000,
onDelay: () => console.log('Reached the interval limit, the call is delayed'),
onDelay: () => {
console.log('Reached the interval limit, the call is delayed');
},
});

const throttled = throttle(() => console.log('Executing...'));
Expand Down

0 comments on commit d9c04ce

Please sign in to comment.