Ruby on Rails Monday, January 13, 2020

Hi,

I managed to send a message from a Stimulus controller to ActionCable, but I'm wondering how you would handle the reception part?

Ideally I'd like the ActionCable javascript `received` function to somehow pass the received message to my stimulus controller(s) and let them do their thing (update targets, etc.).

Is that a good or a bad architecture? Does that even work when there are multiple instances of the same Stimulus controller within the same page?

TL;DR: how do you advise to update the DOM in a clean way when you receive a message with ActionCable?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/069e5175-ba4b-403e-8a0b-51cbb3088c03%40googlegroups.com.

No comments:

Post a Comment