That would make sense to me. The function could be called stream_insert_all as well.
I tried to implement regular pagination using streams, where all items are replaced when you change the page. The solution in short was:
- use dom ID based on index, not based on the item
- reduce over the new items the same way as you do in your
stream_insert_manyfunction - to clear out extra items if the new page has less items than the previous one, reduce over the unused indexes to delete those extra items
In that scenario, it would have been useful to have both stream_insert_all and stream_delete_all_by_dom_id
Even more useful would be a stream_reset to delete all items. With that, I wouldn’t have to use index-based dom IDs.
Instead of adding new *_all functions, the existing ones could also be updated to accept either a single item or a list of items.


















