Skip to content

Commit

Permalink
Fix boxed anonymous function channel decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
bartblast committed Oct 18, 2024
1 parent e6c9e36 commit f63d75c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/hologram/socket/decoder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ defmodule Hologram.Socket.Decoder do

def decode(%{
"type" => "anonymous_function",
"module" => module_str,
"function" => function_str,
"capturedModule" => module_str,
"capturedFunction" => function_str,
"arity" => arity
}) do
module = Module.safe_concat([module_str])
Expand Down
4 changes: 2 additions & 2 deletions test/elixir/hologram/socket/decoder_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ defmodule Hologram.Socket.DecoderTest do
test "anonymous function" do
assert decode(%{
"type" => "anonymous_function",
"module" => "Calendar.ISO",
"function" => "parse_date",
"capturedModule" => "Calendar.ISO",
"capturedFunction" => "parse_date",
"arity" => 2
}) == (&Calendar.ISO.parse_date/2)
end
Expand Down

0 comments on commit f63d75c

Please sign in to comment.