(fn, delay = 50)
| 332 | } |
| 333 | |
| 334 | function debounce(fn, delay = 50) { |
| 335 | let timeout |
| 336 | return arg => { |
| 337 | if (timeout) clearTimeout(timeout) |
| 338 | timeout = setTimeout(() => fn(arg), delay) |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | if (window.page && /^chapter|hints$/.test(window.page.type)) { |
| 343 | chapterInteraction() |