Clone in a terminal:
Commit 0ebe6e2
Johan Mattsson - 2026-10-28T18:04:05+00:00
0ebe6e2edd5fde44e81b5f60ca721fc2631dd2b4johan.mattsson.m@gmail.com

Docs

Changed files (1)

Diff

diff --git a/src/lib.rs b/src/lib.rsindex 3d2f38e..5f6b800 100644--- a/src/lib.rs+++ b/src/lib.rs@@ -2,6 +2,36 @@ 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)

Contact

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