arizona_nova_live (arizona_nova v0.1.0)

View Source

Arizona LiveView integration helpers for Nova routes.

Prefer declaring routes with arizona_nova:routes/1 and {live, ...} tuples. See that module's docs for the recommended usage.

Summary

Functions

Create a Nova route tuple for an Arizona view.

Functions

route(Path, Handler, Opts)

-spec route(string() | binary(), module(), map()) -> {string(), fun(), map()}.

Create a Nova route tuple for an Arizona view.

Handler must be an arizona_view module (includes arizona_view.hrl, exports mount/2). URL path bindings and query params are exposed to mount via the az:request() argument; the route's bindings option is passed as static initial bindings. Route Opts may include layouts, on_mount, and middlewares.

The returned tuple is the Nova route descriptor only -- the corresponding Arizona route declaration is gathered separately by arizona_nova:routes/1 during its transform pass and compiled into the Cowboy dispatch table.