[yew-devel] [RFC yew-comp] refactor: move LoadableComponent state into component implementations

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Dec 10 08:53:56 CET 2025


Spotted another typo, and while checking that I found a parameter name a bit


Am 09.12.25 um 15:36 schrieb Dietmar Maurer:
> +pub struct LoadableComponentState<V: PartialEq> {
> +    loading: usize,
> +    last_load_error: Option<String>,
> +    repeat_timespan: u32, /* 0 => no repeated loading */

nit: repeat is IMO a bit generic for what this is used for and reads a tiny bit
awkwardly to me as I do not recognize that as widely used term for these thing.
Using timespan for interval or polling period feels also slightly odd.

You could use "reload_interval", that's apt, telling and fits to the reload_timeout
below. Adapting the repeated_load function to reload_interval (or set_reload_interval)
would make it also a bit more telling IMO, as is, it's not as clear as it could be
that this is a period for anybody not used to the code.

> +    task_base_url: Option<AttrValue>,
> +    view_state: ViewState<V>,
> +    reload_timeout: Option<Timeout>,
> +    visible: bool,
> +    visibitlity_observer: Option<DomVisibilityObserver>,

Another typo here (drop extra t): s/visibitlity_observer/visibility_observer/

> +    node_ref: NodeRef,
> +    async_pool: AsyncPool,
>  }
>  





More information about the yew-devel mailing list