ghp / packages /client /src /lib /resetStores.ts
QSLY's picture
deploy: build Hugging Face Space from source
00a912e
Raw
History Blame Contribute Delete
439 Bytes
import { useRoomStore } from '@/stores/roomStore'
import { usePlayerStore } from '@/stores/playerStore'
import { useChatStore } from '@/stores/chatStore'
import { resetClockSync } from '@/lib/clockSync'
/** Reset all room-related stores at once (used on leave/disconnect) */
export function resetAllRoomState() {
useRoomStore.getState().reset()
usePlayerStore.getState().reset()
useChatStore.getState().reset()
resetClockSync()
}