how to manually close realtime channel?

I am using svelte. I have two components using the same channel. I want to close the broadcast channel when navigated away from the page.
Was this page helpful?