primer_live icon indicating copy to clipboard operation
primer_live copied to clipboard

Box rows incompatible with streams

Open trentjones21 opened this issue 1 year ago • 1 comments

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.

trentjones21 avatar Oct 22 '23 19:10 trentjones21

I haven't worked with streams yet, so I can't recommend a direction what needs to be changed. PR is certainly welcome!

ArthurClemens avatar Oct 22 '23 19:10 ArthurClemens

Working on it.

ArthurClemens avatar Sep 06 '24 14:09 ArthurClemens