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

atomic14 / web-serial-plotter / 17381877161

01 Sep 2025 03:29PM UTC coverage: 63.077% (+0.1%) from 62.932%
17381877161

push

github

cgreening
Fix build

409 of 519 branches covered (78.81%)

Branch coverage included in aggregate %.

1969 of 3251 relevant lines covered (60.57%)

36.2 hits per line

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

0.0
/src/hooks/useConsoleStore.ts
1
import { useSyncExternalStore } from 'react'
×
2
import { ConsoleStore } from '../store/ConsoleStore'
×
3

4
let consoleStoreInstance: ConsoleStore | null = null
×
5

6
function getConsoleStore(): ConsoleStore {
×
7
  if (!consoleStoreInstance) {
×
8
    consoleStoreInstance = new ConsoleStore(1000) // Default 1000 messages
×
9
  }
×
10
  return consoleStoreInstance
×
11
}
×
12

13
export function useConsoleStore() {
×
14
  const store = getConsoleStore()
×
15
  
16
  const messages = useSyncExternalStore(
×
17
    (callback) => store.subscribe(callback),
×
18
    () => store.getMessages(),
×
19
    () => []
×
20
  )
×
21

22
  return {
×
23
    messages,
×
24
    addIncoming: (content: string, type?: 'data' | 'error' | 'info') => store.addIncoming(content, type),
×
25
    addOutgoing: (content: string, type?: 'data' | 'error' | 'info') => store.addOutgoing(content, type),
×
26
    clear: () => store.clear(),
×
27
    getCapacity: () => store.getCapacity(),
×
28
    setCapacity: (capacity: number) => store.setCapacity(capacity)
×
29
  }
×
30
}
×
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