• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nguyenhuuit / adventofcode-runner / #4

10 Jun 2025 04:49PM UTC coverage: 9.492%. Remained the same
#4

push

nguyenhuuit
ci: publish coverage

20 of 137 branches covered (14.6%)

Branch coverage included in aggregate %.

36 of 453 relevant lines covered (7.95%)

0.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/hooks/useWatcher.ts
1
import chokidar, { FSWatcher } from 'chokidar';
2
import { EventEmitter } from 'events';
3

4
import { useEffect } from 'react';
5

6
const watcher = chokidar.watch([]) as FSWatcher & EventEmitter;
×
7

8
interface UseWatcherProps {
9
  filePath: string;
10
  onChange: () => void;
11
}
12

13
export const useWatcher = ({ filePath, onChange }: UseWatcherProps) => {
×
14
  useEffect(() => {
×
15
    if (!filePath) return;
×
16
    watcher.add(filePath);
×
17
    watcher.removeAllListeners('change');
×
18
    watcher.on('change', onChange);
×
19
    return () => {
×
20
      watcher.unwatch(filePath);
×
21
    };
22
  }, [filePath, onChange]);
23
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc