fn render_iframe_wait_raw<RawData, Mode, Step, Base>(
    _state: Rc<GenericState<RawData, Mode, Step, Base>>,
    on_raw: Rc<Box<dyn Fn(RawData)>>,
) -> Dom
where
    Base: BaseExt + 'static,
    RawData: BodyExt<Mode, Step> + 'static,
    Mode: ModeExt + 'static,
    Step: StepExt + 'static,
{
    html!("empty-fragment", {
        .global_event(clone!(on_raw => move |evt:dominator_helpers::events::Message| {
            if let Ok(msg) = evt.try_serde_data::<IframeInit<RawData>>() {
                log::info!("got iframe data!");
                //on_raw was stashed from the original State::new()
                on_raw(msg.data);
            } else {
                log::info!("hmmm got other iframe message...");
            }
        }))
        .after_inserted(|_elem| {
            //On mount - send an empty IframeInit message to let the *parent* know we're ready
            //parent here is probably the editor window (i.e. we've been told to wait for raw data)
            IframeInit::empty()
                .try_post_message_to_parent()
                .unwrap_ji();
        })
    })
}
//This is just a placeholder to get messages
//It'll be replaced when the iframe data arrives
This is just a placeholder to get messages
It'll be replaced when the iframe data arrives
This is just a placeholder to get messages It ' ll be replaced when the iframe data arrives
fn render_iframe_wait_raw<RawData, Mode, Step, Base>(
    _state: Rc<GenericState<RawData, Mode, Step, Base>>,
    on_raw: Rc<Box<dyn Fn(RawData)>>,
) -> Dom
where
    Base: BaseExt + 'static,
    RawData: BodyExt<Mode, Step> + 'static,
    Mode: ModeExt + 'static,
    Step: StepExt + 'static,
{
    html!("empty-fragment", {
        .global_event(clone!(on_raw => move |evt:dominator_helpers::events::Message| {
            if let Ok(msg) = evt.try_serde_data::<IframeInit<RawData>>() {
                log::info!("got iframe data!");
                //on_raw was stashed from the original State::new()
                on_raw(msg.data);
            } else {
                log::info!("hmmm got other iframe message...");
            }
        }))
        .after_inserted(|_elem| {
            //On mount - send an empty IframeInit message to let the *parent* know we're ready
            //parent here is probably the editor window (i.e. we've been told to wait for raw data)
            IframeInit::empty()
                .try_post_message_to_parent()
                .unwrap_ji();
        })
    })
}
fn render_iframe_wait_raw < RawData , Mode , Step , Base > ( _state : Rc < GenericState < RawData , Mode , Step , Base > > , on_raw : Rc < Box < dyn Fn ( RawData ) > > , ) -> Dom where Base : BaseExt + ' static , RawData : BodyExt < Mode , Step > + ' static , Mode : ModeExt + ' static , Step : StepExt + ' static , { html ! ( " " { global_event ( clone ( on_raw move evt dominator_helpers events Message { if let Ok ( msg ) evt try_serde_data IframeInit RawData ( ) { log info ( " " ) //on_raw was stashed from the original State::new() on_raw ( msg data ) } else { log info ( " " ) } } ) ) after_inserted ( elem { //On mount - send an empty IframeInit message to let the *parent* know we're ready //parent here is probably the editor window (i.e. we've been told to wait for raw data) IframeInit empty ( ) try_post_message_to_parent ( ) unwrap_ji ( ) } ) } ) }
This is just a placeholder to get messages
It'll be replaced when the iframe data arrives
This is just a placeholder to get messages It ' ll be replaced when the iframe data arrives
_state
Rc<GenericState<RawData, Mode, Step, Base>>
on_raw
Rc<Box<dyn Fn(RawData)>>
_state
Rc<GenericState<RawData, Mode, Step, Base>>
on_raw
Rc<Box<dyn Fn(RawData)>>