StarView. Phoenix. Dispatch
(star_view v0.3.2)
Copy Markdown
Marker-based Datastar dispatch for Phoenix controllers.
A controller is dispatchable when it uses use StarView, :controller, which
injects __star_view_handler__/0.
What this plug does
- Reads Datastar signals from the request body.
- Starts the SSE response (
StarView.start/1). - Calls
handle_event/3on the target controller. - Flushes any values tracked with
signal/3asdatastar-signalspatches.
This means your handle_event/3 callbacks never need to call StarView.start/1
or manually send signal patches — just use signal/3 and patch_element/3.