()
| 381 | let timer = null; |
| 382 | if (mode === 'live') { |
| 383 | const pull = () => { |
| 384 | const before = state.events.length; |
| 385 | void readNew().then((added) => { |
| 386 | if (added > 0) { |
| 387 | broadcast(state.events.slice(before)); |
| 388 | } |
| 389 | }); |
| 390 | }; |
| 391 | timer = setInterval(pull, POLL_MS); |
| 392 | try { |
| 393 | watcher = watch(file, pull); |