Live data

Hi guys, I am using an index table - I have a button on it that enqueues an action that runs in the background. Is there a clean way that I can update the table once the background action has finished running?
7 Replies
Smelvin
Smelvin2mo ago
If you are using an AutoTable you could use the prop live Link here to the AutoTable docs for more: https://docs.gadget.dev/reference/react/auto#autotable-
Mash
MashOP2mo ago
Unfortunately its not auto table, I have a lot of actions around the table so I could not use it
Chocci_Milk
Chocci_Milk2mo ago
On your useFindMany there's also the live: true property. Have you looked at that? It makes the hook use a websocket connection to the database
Mash
MashOP2mo ago
ah ok, I will try it now because I am using remix loaders will see if adding live property works
Chocci_Milk
Chocci_Milk2mo ago
To make it live you'll need to use the hook (as far as I'm aware) So the data fetch won't be able to live in the loader
Mash
MashOP2mo ago
ahh ok, that makes sense thanks I might just not use loaders then and use the hook instead
Chocci_Milk
Chocci_Milk2mo ago
I think that in a lot of cases loaders make sense but not in this particular case

Did you find this page helpful?