[yew-devel] [RFC yew-comp] refactor: move LoadableComponent state into component implementations
Dietmar Maurer
dietmar at proxmox.com
Wed Dec 10 10:23:47 CET 2025
On 12/10/25 8:53 AM, Thomas Lamprecht wrote:
> 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.
Maybe we can defer that renaming after the structural changes got in?
Anyways, I will send a v2 including the typo fixes.
Also, Dominik found a way to avoid send_custom_message() and
custom_callback(),
simply by implementing:
impl<M, V: PartialEq> From<M> for Msg<M, V> {
fn from(value: M) -> Self {
Msg::ChildMessage(value)
}
}
More information about the yew-devel
mailing list