pub struct App<Ms: Clone + 'static, Mdl: 'static> {
pub data: Rc<Data<Ms, Mdl>>,
}
We use a struct instead of series of functions, in order to avoid passing
repetative sequences of parameters.
This runs whenever the state is changed, ie the user-written update function is called.
It updates the state, and any DOM elements affected by this change.
todo this is where we need to compare against differences and only update nodes affected
by the state change.
We re-create the whole virtual dom each time (Is there a way around this? Probably not without
knowing what vars the model holds ahead of time), but only edit the rendered, web_sys dom
for things that have been changed.
We re-render the virtual DOM on every change, but (attempt to) only change
the actual DOM, via web_sys, when we need.
The model storred in inner is the old model; updated_model is a newly-calculated one.
Performs copy-assignment from source
. Read more
impl<Ms, Mdl> !Send for App<Ms, Mdl> | |
impl<Ms, Mdl> !Sync for App<Ms, Mdl> | |
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static