We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c4c3200 + ad18365 commit 3c0d3deCopy full SHA for 3c0d3de
packages/react/src/hooks/use-echo.ts
@@ -127,6 +127,10 @@ export const useEcho = <
127
leaveChannel(channel, leaveAll);
128
}, dependencies);
129
130
+ const leave = useCallback(() => {
131
+ tearDown(true);
132
+ }, dependencies);
133
+
134
useEffect(() => {
135
if (initialized.current) {
136
subscription.current = resolveChannelSubscription<TDriver>(channel);
@@ -147,7 +151,7 @@ export const useEcho = <
147
151
/**
148
152
* Leave the channel and also its associated private and presence channels
149
153
*/
150
- leave: () => tearDown(true),
154
+ leave,
155
156
* Stop listening for event(s) without leaving the channel
157
0 commit comments