From b6d7ca340b5c3f8385aa279bdf40099a8e18fca6 Mon Sep 17 00:00:00 2001 From: Zak Stucke Date: Wed, 28 Aug 2024 10:09:03 +0300 Subject: [PATCH] Docs --- src/use_websocket.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/use_websocket.rs b/src/use_websocket.rs index 44a8b4d..ea9ce38 100644 --- a/src/use_websocket.rs +++ b/src/use_websocket.rs @@ -652,6 +652,11 @@ where /// Defaults to `true`. immediate: bool, /// Sub protocols. See [MDN Docs](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/WebSocket#protocols). + /// + /// Can be set as a signal to support protocols only available after the initial render. + /// + /// Note that protocols are only updated on the next websocket open() call, not whenever the signal is updated. + /// Therefore "lazy" protocols should use the `immediate(false)` option and manually call `open()`. #[builder(into)] protocols: MaybeSignal>>, }