Re:React to LiveView for Performance
by arrowsmith on Friday June 23, 2023 @10:07AM
(#36447012)
Typo, too late to edit it now, but `pipe_through [:browsers, :user]` should be `pipe_through [:browsers, :users]` (i.e. `:users` not `:user`.)
Remember that an HTTP request/response cycle in Phoenix is fundamentally just a list of transformations that are applied to a `%Plug.Conn{}`. If you want the same behaviour to apply to multiple controller actions, you can just define that behaviour in a plug function (i.e. a two-arity function that takes and returns a conn), then pass your conn through that plug before it reaches your controller actions.