dioxus-v04-optional-hooks

Crates.iodioxus-v04-optional-hooks
lib.rsdioxus-v04-optional-hooks
version
sourcesrc
created_at2024-05-28 22:41:17.369622
updated_at2024-11-04 07:45:21.84794
descriptionOptional futures for Dioxus 0.4.0-0.4.3
homepage
repositoryhttps://github.com/markcda/dioxus-v04-optional-hooks
max_upload_size
id1254891
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Klimenty Titov (markcda)

documentation

README

dioxus-v04-optional-hooks

Simplifies future hooks that should be reusable.

Usage

use dioxus_v04_optional_hooks::{FutureHook, StartupGuard};
use dioxus::prelude::*;

...

let project_selected = use_state(cx, || 0);
let get_project_card_fut = FutureHook::new(cx, StartupGuard::Enable, (project_selected,), |(project_selected,)| async move {
    get_project_info(*project_selected).await
});

...

cx.render({
    get_project_card_fut.lazy_fetch();
    if let Some(project_card) = get_project_card_fut.read_clone(false) {
        ...
    }
})
Commit count: 17

cargo fmt