Skip to content

Comment on Show HN: Sauron – A web framework in Rust that adheres to the Elm architectureparent

Comments

Not convinced that's the case, with a bit of code splitting the view may end looking more like (pseudo-code):

    fn view(&self) -> Node<Msg> {
        div(self.attributes(), self.content())
    }
    
    fn content(&self) -> Node<Msg> {
        input([
            class("client"), r#type("button"), value("Click me!"),
            onclick(|_| {sauron::log("Button is clicked"); Msg::Click})
        ],[],)
    }

You can also take a look at the window_tab_rows example. It will allow you to modularize into isolated subcomponents which you can embed into the main component.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.