Browse Source

js: add 5 ms delay to compensate from potentially slow server

pull/682/head
Clement Denis 4 years ago
parent
commit
16afd01662
  1. 2
      js/tests/debounce_test.js

2
js/tests/debounce_test.js

@ -27,7 +27,7 @@ const setIntervalSync = (fn, delay, limit = 0) => new Promise(s => {
// if the trailing edge is true it will execute the callback before returning the array // if the trailing edge is true it will execute the callback before returning the array
const run = async (callback, { delay, count }) => { const run = async (callback, { delay, count }) => {
const arr = [] const arr = []
await setIntervalSync(() => callback(arr, 1), delay, count * delay) await setIntervalSync(() => callback(arr, 1), delay, count * delay + 5)
return arr.length return arr.length
} }

Loading…
Cancel
Save