Crate dioxus_storage

Source
Expand description

dioxus_storage

# dioxus-storage A library for handling local storage ergonomically in Dioxus ## Usage ```rust use dioxus_storage::use_storage; 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()}" } } }) } ```

Re-exports§

pub use once_cell;
pub use postcard;

Macros§

set_dir
Set the directory where the storage files are located on non-wasm targets.

Structs§

ClientStorage
StorageEntry
StorageRef
StorageRefMut
UsePersistent
Storage that persists across application reloads

Traits§

StorageBacking

Functions§

use_persistent
A persistent storage hook that can be used to store data across application reloads.