After watching Chris McCord’s keynote about LiveView where he mentions nested streams, I realized this could solve a problem in my application. I’m having some trouble getting it to work though, and replicated what I was seeing in an example repo.
Problem 1: The nested stream does not update with stream_insert and stream_delete
See NestedLive (third example in video). I feel I may not be implementing this in the most pragmatic way. I’m not sure what I would do about something like deleting streams. More importantly though, items aren’t added when stream_insert is called, but when I modify the code to put the stream at the top level, everything works as expected. This is demonstrated in SingleLive (first example in video).
Bonus: Problem 2
This is something I discovered when testing if managing multiple streams via an assign rather than an outer stream worked. Turns out, stream_insert works as expected, but stream_delete does not. See AssignLive (second example in video).
I’m interested to see the trello clone codebase when that comes out, but in the meantime, has anyone implemented this successfully? Does anyone have insight to why my code doesn’t work, or pointers for organizing logic better? And, does anyone know what the bug Chris mentions in the talk is?