Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ealmloff/dioxus-storage


https://github.com/ealmloff/dioxus-storage

Last synced: 8 days ago
JSON representation

Awesome Lists containing this project

README

        


dioxus_storage






Crates.io version



Download



docs.rs docs

# 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()}"
}
}
})
}
```