Crates.io | dioxus_storage |
lib.rs | dioxus_storage |
version | 0.0.4 |
source | src |
created_at | 2023-03-02 19:03:00.212117 |
updated_at | 2023-12-19 15:17:01.872024 |
description | A simple storage library for Dioxus |
homepage | |
repository | https://github.com/Demonthos/dioxus-storage |
max_upload_size | |
id | 799105 |
size | 108,501 |
A library for handling local storage ergonomically in Dioxus
use dioxus_storage::use_persistent;
use dioxus::prelude::*;
fn main() {
dioxus_web::launch(app)
}
fn app(cx: Scope) -> Element {
let num = use_persistent(cx, "count", || 0);
cx.render(rsx! {
div {
button {
onclick: move |_| {
num.modify(|num| *num += 1);
},
"Increment"
}
div {
"{*num.read()}"
}
}
})
}