Clone in a terminal:
Commit 2bdcbb8
Johan Mattsson - 2026-06-01T22:09:50+00:00
2bdcbb87b0c1e126cafbae9825a3e619b169575djohan.mattsson.m@gmail.com

Readme

Changed files (2)

Diff

diff --git a/README.md b/README.mdnew file mode 100644index 0000000..8bd92d8--- /dev/null+++ b/README.md@@ -0,0 +1,32 @@+# Callback Macro++This is a tag for annotating Rust functions that should be used as callbacks in+JavaScript using the kaja-web framework.++Example usage:+```rust+use kaja_html_macro;+use kaja_web::prelude::*;++#[derive(serde::Deserialize)]+struct SomeClickEvent {+    index: usize,+}++#[callback("someClickCallback")]+fn some_on_click_function(event: SomeClickEvent) {+    log!("event.index: {:?}", event.index);+}++// This example allows you to call the Rust function from JavaScript like this:+let html = html! {{+    <button onclick="someClickCallback({+        index: 1+    })">Run WASM Callback</button>+}};+```++## Author and Contact+- Written by Johan Mattsson+- johan.mattsson.m@gmail.com+- https://kajacode.comdiff --git a/src/lib.rs b/src/lib.rsindex b2c87be..de508b3 100644--- a/src/lib.rs+++ b/src/lib.rs@@ -1,3 +1,5 @@+#![doc = include_str!("../README.md")]+ use proc_macro::TokenStream; use quote::quote; use syn::{parse_macro_input, FnArg, Ident, ItemFn, LitStr};

Contact

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