Skip to content

Commit

Permalink
fix(useWebSocket): immediate should only be applied once, close #3676
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Feb 20, 2024
1 parent 3ae45f0 commit 93b96ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/useWebSocket/index.ts
Expand Up @@ -303,7 +303,7 @@ export function useWebSocket<Data = any>(
}

if (immediate)
watch(urlRef, open, { immediate: true })
open()

return {
data,
Expand Down

1 comment on commit 93b96ae

@a982246809
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

urlRef 改变不触发重连了
Changing urlRef not trigger a reconnect anymore

Please sign in to comment.