How to do polling with Inertia #501
-
Hi, how would you implement the polling functionality with inertia? Without Inertia, I would but a Intervall Function and fetch (some) data every x seconds. I am working myself over the PING crm example. I hope you can understand the situation. Cheers |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello guys, I just wanted to give you a short feedback on my own question, because this is very easy to do with inertia. Taking into account how polling should be done in vue (by creating the SetInterval function, google for this or give feedback, if this is not best practice), the way to go is like so:
Link to Manual Visits for possible options. I will be working in this a little bit more, so ask questions if you need some feedback. Christian |
Beta Was this translation helpful? Give feedback.
-
To do what you wanna do, websockets might be the best way of dealing with this. E.g. emitting an event that this page has been updated by another user. Polling works fine as well, probably could do normal API polling with an JSON endpoint rather than fetching the same site. Both work just fine, depends on what you wanna do. |
Beta Was this translation helpful? Give feedback.
Hello guys,
I just wanted to give you a short feedback on my own question, because this is very easy to do with inertia.
Taking into account how polling should be done in vue (by creating the SetInterval function, google for this or give feedback, if this is not best practice), the way to go is like so: