trestle icon indicating copy to clipboard operation
trestle copied to clipboard

WebSockets / action_cable support?

Open hdbreaker opened this issue 2 years ago • 2 comments

Hi guys?

I love Trestle, but the lack of documentation some times drives me crazy. There is a way to refresh a view when an event happen in other application point? like "real time" stuff?

For example:

A real-time counter that grows up when users click in a button

hdbreaker avatar Feb 27 '23 03:02 hdbreaker

Do you maybe support Hotwire? how can I get Realtime at my dashboard?

hdbreaker avatar Mar 20 '23 19:03 hdbreaker

Thinking about how to solve this issue, I was looking that I can use /app/assets/javascripts/trestle/custom.js to poll or connect to ActionCable. Now I'm able to trigger a refresh of the page if a new record is created.

I want to extend this to refresh the frontend data that Trestle is using to populate the view, how can I access/update/overwrite Trestle data object that is used to populate the view from js? There is a way to do that?

hdbreaker avatar Mar 20 '23 21:03 hdbreaker