Hi,
We have a page where we display events to users that relies on infinte scrolling. We decided to migrate from the old phx-update
and temprory assigns fashion to LV Streams to leverage the :reset
option to be able to clear the page when user makes a search with no results and everything works fine. Howerver, we are facing a strange issue when prepending new events with the option at: 0
of the stream
function. This causes the order of items to be reversed on the client side ! the DB request does its job well with the right sorting order so why this option is reversing the order ? is it the normal behavior ? note that we didn’t have this issue before (with phx-update="prepend"
) and as a workaround is to use Enum.reverse()
function :
stream(socket, :events, Enum.reverse(new_events), at: 0)
Thanks for your help