feat(ST-1115): SSE backlog realtime — endpoint, hook, hydration mount, tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-04-30 17:42:32 +02:00
parent 070be76c05
commit 6052aa81fb
5 changed files with 358 additions and 1 deletions

View file

@ -2,6 +2,7 @@
import { useEffect } from 'react'
import { useBacklogStore, type BacklogPbi, type BacklogStory, type BacklogTask } from '@/stores/backlog-store'
import { useBacklogRealtime } from '@/lib/realtime/use-backlog-realtime'
interface InitialData {
pbis: BacklogPbi[]
@ -11,10 +12,11 @@ interface InitialData {
interface BacklogHydrationWrapperProps {
initialData: InitialData
productId: string
children: React.ReactNode
}
export function BacklogHydrationWrapper({ initialData, children }: BacklogHydrationWrapperProps) {
export function BacklogHydrationWrapper({ initialData, productId, children }: BacklogHydrationWrapperProps) {
const setInitialData = useBacklogStore((s) => s.setInitialData)
useEffect(() => {
@ -22,5 +24,7 @@ export function BacklogHydrationWrapper({ initialData, children }: BacklogHydrat
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
useBacklogRealtime(productId)
return <>{children}</>
}