feat(axum): start stateful interactions tersely
Add state_interactions as a small helper for app-owned stateful registries, and use it in the workout exemplar to remove one layer of repetitive route wiring without hiding generated handles or app handlers. req: axum_integration/003 req: ceremony/001 req: dx/003 req: codegen/002 req: examples/001
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use hemplate::Hemplate;
|
||||
use hemx::{Html, IntoEffect};
|
||||
use hemx_axum::{interactions, Form, HandlerRegistry};
|
||||
use hemx_axum::{state_interactions, Form, HandlerRegistry};
|
||||
use hemx_host::{
|
||||
browser_pwa_host_profile, native_shell_host_profile, Capability, CapabilityManifest,
|
||||
CapabilityShape, CapabilityUse, HapticPattern, HostCall, HostCallId, HostEvent,
|
||||
@@ -365,8 +365,7 @@ pub struct RecordNoteInput {
|
||||
|
||||
pub fn registry(state: AppState) -> HandlerRegistry {
|
||||
// req: codegen/002 req: examples/001
|
||||
interactions(ui::BUILD_FINGERPRINT)
|
||||
.with_state(state)
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user