Programming Phoenix LiveView B10.0: Reducer takes a user, not a user_id (page 177)

This sentence is part of the explanation of the for_user reducer:

In our case, our classic reducer takes a user_id and transforms the initial query with an additional where clause.

The reducer function accepts a user argument, not a user_id.

  def for_user(query \\ base(), user) do
    query
    |> where([d], d.user_id == ^user.id)
  end

Thanks! will fix.