Skip to content

Commit 64fb47e

Browse files
flosseDavid-OConnor
authored andcommitted
doc: add hint to seed::update that there is App::update
1 parent 92cd5cc commit 64fb47e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/util.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ pub fn error<D: fmt::Debug>(text: D) {
109109
/// Trigger update function.
110110
/// It requires Msg to be (De)serializable
111111
/// and to register `trigger_update_handler` in `window_events`.
112+
/// Consider to use [`App::update`](struct.App.html#method.update) if you have access to the [`App`](struct.App.html) instance.
112113
pub fn update<Ms>(msg: Ms)
113114
where
114115
Ms: Clone + 'static + serde::Serialize,

src/vdom.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,9 @@ impl<Ms, Mdl, ElC: ElContainer<Ms> + 'static> App<Ms, Mdl, ElC> {
423423
/// We re-render the virtual DOM on every change, but (attempt to) only change
424424
/// the actual DOM, via web_sys, when we need.
425425
/// The model stored in inner is the old model; updated_model is a newly-calculated one.
426+
///
427+
/// If you have no access to the [`App`](struct.App.html) instance you can use
428+
/// alternatively the [`seed::update`](fn.update.html) function.
426429
pub fn update(&self, message: Ms) {
427430
let mut msg_and_cmd_queue: VecDeque<Effect<Ms>> = VecDeque::new();
428431
msg_and_cmd_queue.push_front(message.into());

0 commit comments

Comments
 (0)