Marker-based Datastar dispatch for Phoenix controllers.
A controller is dispatchable when it uses use StarView, 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. - Lets
signal/3patch browser signals immediately as your handler runs.
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.