Files
supabase/apps/reference/_supabase_js/generated/removechannel.mdx
T
2022-08-15 15:27:07 +02:00

54 lines
1.2 KiB
Plaintext

---
id: removechannel
title: 'removeChannel()'
slug: /removechannel
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
---
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Unsubscribes and removes Realtime channel from Realtime client.
```js
supabase.removeChannel(mySubscription)
```
## Parameters
<ul className="method-list-group">
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
channel
</span>
<span className="method-list-item-label-badge required">
required
</span>
<span className="method-list-item-validation">
<code>default</code>
</span>
</h4>
<div class="method-list-item-description">
The name of the Realtime channel.
</div>
</li>
</ul>
## Notes
- Removing subscriptions is a great way to maintain the performance of your project's database. Supabase will automatically handle cleanup 30 seconds after a user is disconnected, but unused subscriptions may cause degradation as more users are simultaneously subscribed.
## Examples
### Remove a subscription
```js
supabase.removeChannel(mySubscription)
```