One thing that I like about the new LV stream/stream_insert APIs is that they require each element to have an :id, which makes reasoning about these things easy: insert your optimistic render into the stream with an id immediately, and when the async result comes back with the same id, inserting it into the collection will replace the optimistic render. You might be able to extend that pattern to your assigns as well.






















