feat(axum): add interaction registry alias
Add an interactions()/on() registration path and move canonical examples off explicit register_handle naming while keeping low-level registry types available underneath. req: axum_integration/003 req: ceremony/001 req: dx/003 req: examples/003
This commit is contained in:
@@ -6,7 +6,7 @@ use futures_util::{stream, StreamExt};
|
||||
use hemplate::Hemplate;
|
||||
use slhx::{CssClass, CssClasses, IntoEffect, RenderSlotExt, SafeHtml};
|
||||
use slhx_axum::{
|
||||
handlers, runtime_js, sse, DispatchRegistry, DispatchRejection, EffectResponse,
|
||||
interactions, runtime_js, sse, DispatchRegistry, DispatchRejection, EffectResponse,
|
||||
InteractionRequest, PageRequest,
|
||||
};
|
||||
use slhx_techdemo::ui;
|
||||
@@ -283,8 +283,8 @@ async fn events(Query(params): Query<BTreeMap<String, String>>) -> impl IntoResp
|
||||
}
|
||||
|
||||
fn registry(shared: Arc<Shared>) -> impl DispatchRegistry {
|
||||
handlers(ui::BUILD_FINGERPRINT)
|
||||
.register_handle(handles::launch_work, {
|
||||
interactions(ui::BUILD_FINGERPRINT)
|
||||
.on(handles::launch_work, {
|
||||
let shared = shared.clone();
|
||||
move |form| {
|
||||
// req: form/002 req: examples/001
|
||||
@@ -303,7 +303,7 @@ fn registry(shared: Arc<Shared>) -> impl DispatchRegistry {
|
||||
demo_effects(&demo, "Launch accepted · 4 targets updated")
|
||||
}
|
||||
})
|
||||
.register_handle(card_handles::advance_work, {
|
||||
.on(card_handles::advance_work, {
|
||||
let shared = shared.clone();
|
||||
move |form| {
|
||||
// req: list/003 req: examples/001
|
||||
@@ -321,7 +321,7 @@ fn registry(shared: Arc<Shared>) -> impl DispatchRegistry {
|
||||
demo_effects(&demo, "Pipeline advanced")
|
||||
}
|
||||
})
|
||||
.register_handle(lane_handles::move_to_lane, {
|
||||
.on(lane_handles::move_to_lane, {
|
||||
let shared = shared.clone();
|
||||
move |form| {
|
||||
// req: list/003 req: examples/001
|
||||
@@ -343,7 +343,7 @@ fn registry(shared: Arc<Shared>) -> impl DispatchRegistry {
|
||||
demo_effects(&demo, "Drag-and-drop move persisted")
|
||||
}
|
||||
})
|
||||
.register_handle(card_handles::delete_work, {
|
||||
.on(card_handles::delete_work, {
|
||||
let shared = shared.clone();
|
||||
move |form| {
|
||||
// req: list/003 req: examples/001
|
||||
@@ -362,7 +362,7 @@ fn registry(shared: Arc<Shared>) -> impl DispatchRegistry {
|
||||
demo_effects(&demo, "Card removed")
|
||||
}
|
||||
})
|
||||
.register_handle(card_handles::spotlight_work, {
|
||||
.on(card_handles::spotlight_work, {
|
||||
let shared = shared.clone();
|
||||
move |form| {
|
||||
// req: examples/001
|
||||
@@ -377,7 +377,7 @@ fn registry(shared: Arc<Shared>) -> impl DispatchRegistry {
|
||||
demo_effects(&demo, "Inspector focused")
|
||||
}
|
||||
})
|
||||
.register_handle(handles::simulate_push, {
|
||||
.on(handles::simulate_push, {
|
||||
let shared = shared.clone();
|
||||
move |_| {
|
||||
// req: push/003 req: examples/001
|
||||
@@ -393,7 +393,7 @@ fn registry(shared: Arc<Shared>) -> impl DispatchRegistry {
|
||||
)
|
||||
}
|
||||
})
|
||||
.register_handle(handles::reset_demo, {
|
||||
.on(handles::reset_demo, {
|
||||
let shared = shared.clone();
|
||||
move |_| {
|
||||
// req: examples/001
|
||||
|
||||
Reference in New Issue
Block a user