Carl (klequis)
Carl (klequis)
SSolidJS
Created by gsoutz on 3/10/2025 in #support
query function invalidates the cache every 10 clicks
Oops. I followed bad etiquette and asked a question on someone else's question. It was a good discussion, thanks!
34 replies
SSolidJS
Created by gsoutz on 3/10/2025 in #support
query function invalidates the cache every 10 clicks
Or perhaps CACHE_TIMEOUT is just a way of timing a clean-up.
34 replies
SSolidJS
Created by gsoutz on 3/10/2025 in #support
query function invalidates the cache every 10 clicks
So, that sounds like? 1. After PRELOAD_TIMEOUT a hover over a link won't have a cache available 2. The data stays in the cach until CACHE_TIMEOUT, and then - a) the cache is empty? - b) the cache no longer exists? I suspect the answer to this is above but I didn't get it: How can a user or Solid itself use the data during the period between PRELOAD_TIMEOUT and CACHE_TIMEOUT?
34 replies
SSolidJS
Created by gsoutz on 3/10/2025 in #support
query function invalidates the cache every 10 clicks
query.ts
34 replies
SSolidJS
Created by gsoutz on 3/10/2025 in #support
query function invalidates the cache every 10 clicks
I'll need more time to digest what you guys just said but I did notice in the code that there are two timeouts that may be related to the discussion:
const PRELOAD_TIMEOUT = 5000;
const CACHE_TIMEOUT = 180000;
const PRELOAD_TIMEOUT = 5000;
const CACHE_TIMEOUT = 180000;
Do you know what the difference is?
34 replies
SSolidJS
Created by gsoutz on 3/10/2025 in #support
query function invalidates the cache every 10 clicks
ok technically the cache is long-lived since the data doesn't just disappear, but it's considered stale after a very short time. revalidate is so that you can refetch the data manually, since query doesn't automatically refetch when it becomes stale
So you are saying that revalidate revalidates the 'data in the cache'? And if so, does it still only last a very short time?
34 replies
SSolidJS
Created by Carl (klequis) on 3/6/2025 in #support
Store update produces error "current is undefined"
Super helpful pointing out the code. Thank you!
33 replies
SSolidJS
Created by Carl (klequis) on 3/6/2025 in #support
Store update produces error "current is undefined"
I wondered if the function had to be a filter and it appears it must be because this doesn't work:
setStore("users", 0, () => "loggedIn", true);
setStore("users", 0, () => "loggedIn", true);
I'm still curious to examine more but it is late so tomorrow.
33 replies
SSolidJS
Created by Carl (klequis) on 3/6/2025 in #support
Store update produces error "current is undefined"
These two work:
setState("users", (user) => user.loggedIn, "loggedIn", false);

setState("users", (user) => user.id < 2, "loggedIn", true);
setState("users", (user) => user.loggedIn, "loggedIn", false);

setState("users", (user) => user.id < 2, "loggedIn", true);
33 replies
SSolidJS
Created by Carl (klequis) on 3/6/2025 in #support
Store update produces error "current is undefined"
No description
33 replies
SSolidJS
Created by Carl (klequis) on 3/6/2025 in #support
Store update produces error "current is undefined"
Not understanding the source code for this (I did peek), it looks a bit magical that the loggedIn key is found, but it's a really nice feature.
33 replies
SSolidJS
Created by Carl (klequis) on 3/6/2025 in #support
Store update produces error "current is undefined"
Nice!
33 replies
SSolidJS
Created by Carl (klequis) on 3/6/2025 in #support
Store update produces error "current is undefined"
Thank you, the first one. The doc has:
setStore([0,2], (user) => user.loggedIn, false);
setStore([0,2], (user) => user.loggedIn, false);
It's an image from Eraser I can't edit. I'll open an issue. I wanted to see how to use a function as in the doc example. This makes a nice toggle.
setStore("users", [0,2], (user) => ({ loggedIn: !user.loggedIn}))
setStore("users", [0,2], (user) => ({ loggedIn: !user.loggedIn}))
33 replies
SSolidJS
Created by Spaghetto on 10/8/2024 in #support
Can't make Router Work
Did you look in the browsers dev console for an error?
14 replies
SSolidJS
Created by Spaghetto on 10/8/2024 in #support
Can't make Router Work
That code works for me.
14 replies
SSolidJS
Created by laksh on 7/1/2024 in #support
I have a use case for createResource vs normal async await api call.
current router version is 0.13.6. I don't know the exact version createAsync was introduced but it was in 0.10.x which was a significant change. The doc has all be updated so maybe consider upgrading if you haven't already.
18 replies
SSolidJS
Created by Carl (klequis) on 6/17/2024 in #support
Routing: Component/UI Element not rendered
I'll open an issue for this.
4 replies
SSolidJS
Created by Carl (klequis) on 6/17/2024 in #support
Routing: Component/UI Element not rendered
Additionally, - sometimes rather than the component not rendering it routes to routes/[...404].jsx - I switched to Chrome and am having the same issue.
4 replies
SSolidJS
Created by Carl (klequis) on 6/17/2024 in #support
Routing: Component/UI Element not rendered
4 replies