diff --git a/examples/workout/src/lib.rs b/examples/workout/src/lib.rs index 6d783f9..a68c3b0 100644 --- a/examples/workout/src/lib.rs +++ b/examples/workout/src/lib.rs @@ -1,6 +1,6 @@ use hemplate::Hemplate; use hemx::{Html, IntoEffect}; -use hemx_axum::{state_interactions, Form, HandlerRegistry}; +use hemx_axum::Form; use hemx_host::{ browser_pwa_host_profile, native_shell_host_profile, Capability, CapabilityManifest, CapabilityShape, CapabilityUse, HapticPattern, HostCall, HostCallId, HostEvent, @@ -363,9 +363,9 @@ pub struct RecordNoteInput { text: String, } -pub fn registry(state: AppState) -> HandlerRegistry { +pub fn interactions(state: AppState) -> impl hemx_axum::DispatchRegistry { // req: codegen/002 req: examples/001 - state_interactions(ui::BUILD_FINGERPRINT, state) + hemx_axum::state_interactions(ui::BUILD_FINGERPRINT, state) .on_state(ui::workout::complete_set, complete_set) .on(ui::workout::change_weight, change_weight_form) .on_state(ui::workout::skip_exercise, skip_exercise) @@ -374,10 +374,7 @@ pub fn registry(state: AppState) -> HandlerRegistry { .on_state(ui::workout::export_log, export_log) .on_state(ui::workout::record_share_result, record_share_result) .on_state(ui::workout::request_native_haptic, request_native_haptic) - .on_state( - ui::workout::record_native_haptic_ack, - record_native_haptic_ack, - ) + .on_state(ui::workout::record_native_haptic_ack, record_native_haptic_ack) .into_registry() } diff --git a/examples/workout/src/main.rs b/examples/workout/src/main.rs index f879de5..8add613 100644 --- a/examples/workout/src/main.rs +++ b/examples/workout/src/main.rs @@ -39,7 +39,7 @@ async fn interact( State(state): State, request: InteractionRequest, ) -> Result { - request.dispatch_async(workout_app::registry(state)).await + request.dispatch(workout_app::interactions(state)) } async fn workout_css() -> impl IntoResponse {