Dropping rxgo (#201)

* rxgo event source to channel with drop strategy

* code optimizations
This commit is contained in:
Marco Piovanello
2024-09-18 17:49:25 +02:00
committed by GitHub
parent a00059ca88
commit 64fbdbbbdf
6 changed files with 114 additions and 135 deletions

View File

@@ -22,8 +22,8 @@ const LogTerminal: React.FC = () => {
useEffect(() => {
eventSource.addEventListener('log', event => {
const msg: string[] = JSON.parse(event.data)
setLogBuffer(buff => [...buff, ...msg].slice(-500))
const msg: string = JSON.parse(event.data)
setLogBuffer(buff => [...buff, msg].slice(-500))
boxRef.current?.scrollTo(0, boxRef.current.scrollHeight)
})