Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ealmloff/dioxus-storage
https://github.com/ealmloff/dioxus-storage
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ealmloff/dioxus-storage
- Owner: ealmloff
- Created: 2023-02-13T20:43:51.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-19T15:16:47.000Z (about 1 year ago)
- Last Synced: 2024-12-16T00:51:48.523Z (22 days ago)
- Language: Rust
- Size: 34.2 KB
- Stars: 11
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
dioxus_storage
# dioxus-storage
A library for handling local storage ergonomically in Dioxus
## Usage
```rust
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()}"
}
}
})
}
```