phoenix-playground / phoenix_playground

Phoenix Playground makes it easy to create single-file Phoenix applications.
https://hexdocs.pm/phoenix_playground
206 stars 19 forks source link

Delegate LiveView handle_params/3 #7

Closed crbelaus closed 3 months ago

crbelaus commented 3 months ago

I am toying with the Phoenix Playground and finding it very useful so far.

I was implementing the handle_params/3 callback in my LiveView and noticed that it was not being called. After a quick inspection it turns out that the DelegateLive module is not delegating that callback.

This pull request implements that delegation so the handle_params/3 will be called if the delegated LiveView implements it. Since the DelegateLive implements that callback it will always be called after mount so, if the delegated LiveView does not implement it, it will not be called.

wojtekmach commented 3 months ago

Thank you!