Closed zakstucke closed 2 weeks ago
Second commit is adding web-sys
as a dep to the use_websocket
Cargo.toml
feature, compilation fails otherwise when it's the only enabled feature.
Thanks for this!
I get the need for this and I agree, it feels a bit weird. However I can't find a better solution 😂 Could you maybe add docs to this option, that it can be a signal but is only read when open is called?
Okay cool, I've added some comments to the protocols
option.
Perfect, thanks!
I have a need to use the
protocols
option of websockets, but I can only get them asyncronously. This PR provides a way to have "async" protocols by wrappingOption<Vec<String>>
inMaybeSignal
. Combining e.g. an async resource as the protocol signal withopts.immediate(false)
and manually callingws.open()
once the resource has loaded solves the issue.This is definitely a weird implementation though, if you have a better way to do it I can update the PR?
This shouldn't be a breaking change, all previous config of the protocol option should be unaffected, due to the
impl Into<MaybeSignal<...>>