(fn, wait)
| 4343 | } |
| 4344 | |
| 4345 | function debounce (fn, wait) { |
| 4346 | let timestamp, timeout |
| 4347 | |
| 4348 | function later () { |
| 4349 | const last = Date.now() - timestamp |
| 4350 | if (last < wait && last >= 0) { |
| 4351 | timeout = setTimeout(later, wait - last) |
| 4352 | } else { |
| 4353 | timeout = null |
| 4354 | fn() |
| 4355 | } |
| 4356 | } |
| 4357 | |
| 4358 | return function () { |
| 4359 | timestamp = Date.now() |
| 4360 | if (!timeout) timeout = setTimeout(later, wait) |
| 4361 | } |
| 4362 | } |
| 4363 | |
| 4364 | class NodePool { |
| 4365 | constructor () { |
no outgoing calls
no test coverage detected
searching dependent graphs…