Leptos Websocket
Leptos Websocket provides real-time, reactive signals for Leptos, keeping them in sync with the server through WebSockets. This enables instant UI updates controlled by the server or shared between client and server.
Features
- Server Signals: Read-only on the client, writable by the server.
- Bidirectional Signals: Read-write on both client and server; updates are synchronized in both directions.
- Channel Signals: Message-based channels for sending and receiving discrete messages between client and server.
- Real-time Updates: Changes to signals are sent through WebSockets as JSON patches.
- Framework Integration: Supports integration with Axum and Actix Web.
Installation
Add the following to your Cargo.toml:
[]
= "0.9.0"
= { = "1.0", = ["derive"] }
[]
= ["leptos_ws/hydrate"]
= ["leptos_ws/ssr"]
Usage
use *;
use ReadOnlySignal;
use ;
async
Feature Flags
ssr: Enable server-side rendering support.hydrate: Enable hydration support.csr: Enable client-side rendering support.
Documentation
For more detailed information, check out the API documentation.
Compatible Leptos versions
The main branch is compatible with the latest Leptos release.
Compatibility of leptos_ws versions:
leptos_ws |
leptos |
|---|---|
0.8-0.9 |
0.8 |
0.7 |
0.7 |
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.