-
Notifications
You must be signed in to change notification settings - Fork 17
Description
HI @jorgemanrubia,
i watched the video and played with Turbo 8 refreshes. Working great for me but i have 2 questions i can't find an a proper answer to. Hope it's ok to open an issue for it as i am not sure where else to ask given the examples.
1. Creating a stream per project
In the demo app you are creating a separate stream per project:
<% @projects.each do |project| %>
<%= turbo_stream_from project %>
<% end %>
Would this not create a lot of streams with a page of say 15-20 projects? Would love to know if this is a performance concern or not - as i would prefer it a lot over what i am doing currently:
Index.html.erb
turbo_stream_from [current_account, "projects"]
project.rb
after_update_commit { broadcast_replace_later_to [account, "projects"] }
I have 1 stream but have to scope it to current_account so only the project owner subscribes to the stream. Would appreciate your opinion this.
2. Scoping stream by passing an array to broadcasts_refreshes
I ended up with the above question because passing an array, to keep having a single stream with a string identifier, did not work for me in testing
broadcasts_refreshes [account, "projects"]
Is this an mistake on my side or is the idea with broadcasts_refreshes to subscribe to all items directly and not need to scope a stream for security reasons, like in the case above?