Thanks to visit codestin.com Credit goes to github.com
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.
1 parent 209de63 commit ece6a39Copy full SHA for ece6a39
packages/core/useWebSocket/index.ts
@@ -198,7 +198,7 @@ export function useWebSocket<Data = any>(
198
199
// Status code 1000 -> Normal Closure https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/code
200
const close: WebSocket['close'] = (code = 1000, reason) => {
201
- if (!isClient || !wsRef.value)
+ if ((!isClient && !isWorker) || !wsRef.value)
202
return
203
explicitlyClosed = true
204
resetHeartbeat()
0 commit comments