Leptos Websocket
Leptos Websocket provides server signals for Leptos, keeping them in sync with the server through WebSockets. This enables real-time updates on the UI controlled by the server.
Features
- Server Signals: Read-only signals on the client side, writable by the server.
- Real-time Updates: Changes to signals are sent through WebSockets as JSON patches.
- Framework Integration: Supports integration with the Axum web framework.
Installation
Add the following to your Cargo.toml:
[]
= "0.7.8"
= { = "1.0", = ["derive"] }
[]
= ["leptos_ws/ssr", "leptos_ws/axum"]
Usage
Client-side
use *;
use ;
Server-side (Axum)
Server-side implementation requires additional setup. Refer to the example for detailed examples.
Feature Flags
ssr: Enable server-side rendering support.axum: Enable integration with the Axum web framework.
Documentation
For more detailed information, check out the API documentation.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.