Infinite context loop in start dev?
Hi, I have , and I'm noticing that this createResource is running forever as fast as possible, on the server, when its in dev. I'm trying to discover the root cause of it, but it only happens in dev. I'm posting this half for help, and half to help others when I uncover the issue
10 Replies
output of console.trace
Ok so its not even the resource being run forever
the closure keeps getting called
interestingly, this too is being called forever
Has probably something to do with the way createContextProvider is implemented?
But if you are working with solid start and solid router you can use createAsync with cache helper which kind of like a global context for async data.
Looks like this
https://docs.solidjs.com/solid-start/building-your-application/data-loading
Yeah unfortunately I’m locked into resources for mutational abilities though it’s possible I could proxy the cache through a store. I’ll try
You can “mutate“ with actions which revalidate the cache. Or you can use the revalidate helper to trigger revalidation.
I understand that, but it is a useless additional network callw ehn I already understand the exact mutation that will happen
You can manually update on the client if you need with
cache.set(getUser.key, value)
oooh, chill
how do I access the cache function?
it's just
cache
from @solidjs/router
did you ever get that to work?