Clone in a terminal:
lib.rs
src/ - Docs
mod init; use proc_macro as pm; /// ```rust,ignore /// use kaja_web::prelude::*; /// /// #[component("main-component")] /// struct Main { /// #[attribute] /// test: bool, /// } /// /// impl Component for MainComponent { /// fn connected(&self) { /// log!("Connected:", self.get_id()); /// } /// /// fn disconnected(&self) { /// log!("Disconnected:", self.get_id()); /// } /// /// fn attribute_changed(&self, name: &str, _old: &str, _new: &str) { /// if name == "test" { /// let value: bool = self.get_attribute("test").unwrap_or_default(); /// log!("Test:", value); /// } /// } /// } /// ``` /// /// ```html /// <main-component test="true"></main-component> /// ``` #[proc_macro_attribute] pub fn component(attr: pm::TokenStream, item: pm::TokenStream) -> pm::TokenStream { init::component_impl(attr, item) }

File history (8 commits)

0ebe6e2 Johan Mattsson - johan.mattsson.m@gmail.com
Docs
Docs
64b7900 Johan Mattsson - johan.mattsson.m@gmail.com
Merge branch 'next-component'
Merge branch 'next-component'
834889e Johan Mattsson - johan.mattsson.m@gmail.com
Fix attribute annotation
Fix attribute annotation
6a72ca2 Johan Mattsson - johan.mattsson.m@gmail.com
Annotate attributes
Annotate attributes
c71203e Johan Mattsson - johan.mattsson.m@gmail.com
Global store
Global store
840a569 Johan Mattsson - johan.mattsson.m@gmail.com
Make all components derive default
Make all components derive default
f7d721a Johan Mattsson - johan.mattsson.m@gmail.com
Init state function
Init state function
8e08a53 Johan Mattsson - johan.mattsson.m@gmail.com
Init functon from annotated struct
Init functon from annotated struct

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112