class
UI::ActionDispatcher
- UI::ActionDispatcher
- Reference
- Object
Overview
Per-app coordinator that translates UI actions into navigation operations or inline view renders.
Defined in:
asset_pipeline/action_dispatcher.crConstructors
Instance Method Summary
- #app : UI::App.class
- #current_form_state : UI::FormState
-
#current_mount_token : Int64
Monotonically-increasing mount token.
- #design_tokens : UI::DesignTokens::Tokens
-
#dispatch(action_ref : Symbol | Tuple(UI::Controller.class, Symbol), explicit_params : Hash(String, String) = {} of String => String) : Nil
Resolve + dispatch an action_ref.
- #flash : UI::Flash
-
#mount_screen(route : UI::NavigationCoordinator::Route) : Nil
Called when a new screen mounts.
-
#mount_screen(route_id : Symbol) : Nil
Convenience overload that resolves the route from the coordinator (the route_id is asserted to match the coord's current route).
- #navigation : UI::NavigationCoordinator
-
#on_render_inline : Proc(UI::View, Nil) | Nil
Optional callback for
UI::ActionResult::RenderInlineresults. -
#on_render_inline=(on_render_inline : Proc(UI::View, Nil) | Nil)
Optional callback for
UI::ActionResult::RenderInlineresults. - #session : UI::Session
Constructor Detail
Instance Method Detail
Monotonically-increasing mount token. The dispatcher writes this
to UI::FormState.current_mount_token on every screen mount so
the renderer's stale-callback guard fires correctly.
Resolve + dispatch an action_ref. Builds a fresh Native context
with the dispatcher's current FormState + the explicit params
from the action_ref's button. Runs before_actions on the
resolved controller class; if any returns a UI::ActionResult,
the dispatch short-circuits. Otherwise calls dispatch_action
and translates the returned result via translate_result.
Convenience overload that resolves the route from the coordinator
(the route_id is asserted to match the coord's current route).
Useful for #mount_screen(route_id) callers that have already
pushed the route onto the coord and want to mount based on it.
Optional callback for UI::ActionResult::RenderInline results.
The host (macOS / iOS) wires this on startup to present the
inline view (e.g. sheet, popover) without disturbing the
navigation stack.
Optional callback for UI::ActionResult::RenderInline results.
The host (macOS / iOS) wires this on startup to present the
inline view (e.g. sheet, popover) without disturbing the
navigation stack.