4 releases

0.0.4 Dec 19, 2023
0.0.3 Oct 12, 2023
0.0.2 Aug 9, 2023
0.0.1 Mar 2, 2023

#1615 in Parser implementations

Download history 2/week @ 2023-12-17 5/week @ 2024-01-28 29/week @ 2024-02-18 10/week @ 2024-02-25 65/week @ 2024-03-31

65 downloads per month

MIT/Apache

28KB
512 lines

dioxus_storage

dioxus-storage

A library for handling local storage ergonomically in Dioxus

Usage

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

Dependencies

~8–11MB
~214K SLoC