Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix custom handle_event and handle_info couldn't be defined in Live Resource #681

Merged
merged 2 commits into from
Nov 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions lib/backpex/live_resource.ex
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,6 @@ defmodule Backpex.LiveResource do
@impl Phoenix.LiveView
def handle_params(params, url, socket), do: LiveResource.handle_params(params, url, socket)

@impl Phoenix.LiveView
def handle_event(event, params, socket), do: LiveResource.handle_event(event, params, socket)

@impl Phoenix.LiveView
def handle_info(msg, socket), do: LiveResource.handle_info(msg, socket)

@impl Phoenix.LiveView
def render(assigns), do: LiveResource.render(assigns)

Expand Down Expand Up @@ -313,8 +307,16 @@ defmodule Backpex.LiveResource do
quote do
import Backpex.HTML.Layout
import Backpex.HTML.Resource

alias Backpex.LiveResource
alias Backpex.Router

@impl Phoenix.LiveView
def handle_event(event, params, socket), do: LiveResource.handle_event(event, params, socket)

@impl Phoenix.LiveView
def handle_info(msg, socket), do: LiveResource.handle_info(msg, socket)

@impl Backpex.LiveResource
def panels, do: []

Expand Down