primer_live
primer_live copied to clipboard
Box rows incompatible with streams
Perhaps this is outside the scope of this library, but I don't see any similar issues so I thought I'd at least start a discussion.
It would be really nice if rows were compatible with streams. Currently this code:
<.box>
<:row :for={{dom_id, message} <- @streams.messages}>
<!-- ... -->
</:row>
</.box
errors with the following message:
streams can only be consumed directly by a for comprehension.
If you are attempting to consume the stream ahead of time, such as with
`Enum.with_index(@stream.messages)`, you need to place the relevant information
within the stream items instead.
Is natively iterating over streams something this library is interested in handling? I can look at creating a PR when I have some time, but only if that's the direction this library would want to take.
I haven't worked with streams yet, so I can't recommend a direction what needs to be changed. PR is certainly welcome!
Working on it.