Phoenix.LiveView.Helpers.live_patch/2 dynamically?

I am working on a pagination behaviour/component. I would like to dynamically use Phoenix.LiveView.Helpers.live_patch/2 to change the page. Given a standard %Phoenix.LiveView.Socket{}, how can I do this without specifically defining the route on the to: param? Since I have named routes, Phoenix.Router.Helpers.live_path doesn’t seem to work.

If it can’t be done dynamically, I would love some suggestions on the best way to do this. Thanks!

Can you do this using __MODULE__? Like:

def live_path(socket, params) do