Dioxus hooks for websocket connections
```rust use dioxuswebsockethooks::{usewscontext, usewscontextproviderjson};
fn app(cx: Scope) -> Element { usewscontextproviderjson(&cx, "wss://echo.websocket.events", move |msg| { // Handle incoming ws message, e.g. store it in shared state });
...
}
fn ExampleComponent(cx: Scope) -> Element { let ws = usewscontext(&cx);
cx.render(rsx! (
button { onclick: move |_| ws.send_json(&"hello"), "Submit" }
))
} ```
See cargo examples
Samples make use of fermi for state management.