diff --git a/index.d.ts b/index.d.ts index e43583b..fa9c800 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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...')); diff --git a/readme.md b/readme.md index cc88cbc..3dbcf4c 100644 --- a/readme.md +++ b/readme.md @@ -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...'));