Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
halfdan committed Mar 12, 2024
1 parent aa82c5f commit ed728c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/cereal/builders/entity.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ defmodule Cereal.Builders.Entity do
import Plug.Conn, only: [assign: 3]

def build(%{data: data} = context) when is_list(data) do
data |> Enum.map(fn entity ->
data
|> Task.async_stream(fn entity ->
context
|> Map.put(:data, entity)
|> build()
end)
|> Enum.map(fn({:ok, result}) -> result end)
end

def build(%{serializer: serializer} = context) do
Expand Down

0 comments on commit ed728c3

Please sign in to comment.