Spaces:
Runtime error
Runtime error
File size: 300 Bytes
27bb457 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import { onDestroy } from "svelte";
import { useRoom } from "./useRoom";
export function useErrorListener(callback: (err: Error) => void): void {
const room = useRoom();
const unsubscribe = room.events.error.subscribe((e: Error) => callback(e))
onDestroy(() => {
unsubscribe();
});
} |