What's a good way to deliver missed messages in a chat for instance with Action Cable? Like when you close the laptop and open it again, you are not reloading the page but you may have missed messages
One way would be to do an AJAX call instead using Action Cable but then i would have to duplicate some of the logic that happens when you receive a message. I would like to just reuse Action Cable if possible
You could use
#transmit
to send past message in#subscribed
.Unfortunately this handy method is barely documented and not mentioned in the current edge guide for Action Cable. But should work in all versions since Action Cable was introduced.
Here's an example: