Help: Table is not updating after adding new record #223
-
I'm really new to svelte and sveltekit, so please stick with me. I've built a gRPC backend in Go using connectrpc & bufbiuld. That all working perfectly. In my +page.server.ts i'm pulling from my gRPC find function in the load function as follows.
In my +page.svelte i'm then using this response data to build my svelte-headless-table as follows:
When I load the page it works fine an i see all the records along with their names & timestamps in the table. Great! Next, i'm using sveltkit-superforms to add records at the backend using my gRPC create function. With sveltekit-superforms im using progressive enhancement, which by default will invalidateAll after successful submission. This invalidateall causes my load function to run again, which i do want, as I want to see the new record I just add. Again, this works, I can see via the console logs that the load function is getting re-run and the new record I just added is in the result. Great! But.... why is my svelte-headless-table not showing the new record? I've to to refresh the page in order for it to show up. Conversely, if I add a simple each block:
I see the new record instantly inside the each block. So, why is my svelte-headless-table not reacting to the new record in the productTypes array, but the each block is? I've probably missed some really simple concept here and hopefully it's a simple fix. Thanks for reading! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Apologies, answered in #105. |
Beta Was this translation helpful? Give feedback.
Apologies, answered in #105.