Next.js Discord

Discord Forum

Polling with server action

Unanswered
Ratonero Bodeguero Andaluz posted this in #help-forum
Open in Discord
Avatar
Ratonero Bodeguero AndaluzOP
I'm trying to fetch some status from db and update UI according to it. For this I know using SWR is a good fit. But since I'm using server action to do the fetching, what is the way to do this polling? Thanks.

2 Replies

Avatar
English Angora
you can use a useEffect and put a timer/interval inside
Avatar
Ratonero Bodeguero AndaluzOP
Thanks, that's what I have in mind for now, just wonder if there're new tricks for it