nzdeep
nzdeep
SSolidJS
Created by Vincent Udén on 7/6/2023 in #support
createResource refetch causes full page refresh
Once you've sorted out the Suspense boundary you can also wrap refetchProject in startTransition is you wanted to avoid the fallback and use a more softer inline clue for reloading via isPending - useTransition will hand you both isPending accessor and start Transition
9 replies
SSolidJS
Created by Massukka on 6/22/2023 in #support
Increment counter every time component is used?
Ah okay, yeah my opinion based on client-side app only, I've not played with the server side story yet
15 replies
SSolidJS
Created by Abrinzer on 6/22/2023 in #support
how to add debounce to any signal setter ?
yeah ignore the "better approach" that's also bad.. edited what the expensive opereation you need to debounce
11 replies
SSolidJS
Created by Abrinzer on 6/22/2023 in #support
how to add debounce to any signal setter ?
sorry I mean what the effect calls
11 replies
SSolidJS
Created by Massukka on 6/22/2023 in #support
Increment counter every time component is used?
I think its easy to overthink in any framework, part of the joy of novelty, let's play the whole API surface, when reality simple primitives can work / do work better
15 replies
SSolidJS
Created by Massukka on 6/22/2023 in #support
Increment counter every time component is used?
side thought.. Definitely this commnity needs a sticky on Context abuse somewhere
15 replies
SSolidJS
Created by Massukka on 6/22/2023 in #support
Increment counter every time component is used?
What do you need a signal and a context ?
15 replies
SSolidJS
Created by Massukka on 6/22/2023 in #support
Increment counter every time component is used?
const compCreationCount = { thingComponent: 0 } const Thing = (props) { const iAmIncarnationNumber = compCreationCount.thingComponent++ return <p>me is: {iAmIncationNumber} </p> }
15 replies
SSolidJS
Created by Abrinzer on 6/22/2023 in #support
how to add debounce to any signal setter ?
e.g. like a search text autocomplete ajax call
11 replies
SSolidJS
Created by Abrinzer on 6/22/2023 in #support
how to add debounce to any signal setter ?
a better approach is debounce the expensive parts of an effects or memo of a signal (not the effect / memo itself)
11 replies
SSolidJS
Created by Abrinzer on 6/22/2023 in #support
how to add debounce to any signal setter ?
and you'll potentially run into many problems
11 replies
SSolidJS
Created by Abrinzer on 6/22/2023 in #support
how to add debounce to any signal setter ?
set signal is meant to be fully sync
11 replies
SSolidJS
Created by Abrinzer on 6/22/2023 in #support
how to add debounce to any signal setter ?
I would not recommend this
11 replies
SSolidJS
Created by Abrinzer on 6/22/2023 in #support
how to add debounce to any signal setter ?
However..
11 replies
SSolidJS
Created by Abrinzer on 6/22/2023 in #support
how to add debounce to any signal setter ?
pretty easy with debounce lib (https://github.com/solidjs-community/solid-primitives/tree/main/packages/scheduled#debounce) const [signal, rawSetSignal] = createSignal(1); const setSignal = debounce(rawSetSignal, 250); // use setSignal
11 replies
SSolidJS
Created by Nyantastic on 6/19/2023 in #support
Trying to test a component containing a createResource
This is basically as expected, you need to grok the idea that components only run once to setup all the reactivity tracking, and the unlike react suspense doesn't work by throwing promises, and chaining on them and re-running. So you need to guard around resource() being undefined. before access properties of the eventual value
8 replies
SSolidJS
Created by Nyantastic on 6/19/2023 in #support
Trying to test a component containing a createResource
So accessing resource().x will throw an exception access property on undefined - you'll see this in the console window
8 replies
SSolidJS
Created by Nyantastic on 6/19/2023 in #support
Trying to test a component containing a createResource
On the first pass (actually the only pass) resource be will Pending state initially in this case, it won't have executed the fetcher yet even if it is Promise.resolve for the data fetcher - https://playground.solidjs.com/anonymous/7c5e999e-36f5-444f-a1ea-5ab7c6311511
8 replies
SSolidJS
Created by nzdeep on 6/10/2023 in #support
Is there any scenario where batch wouldn't be fully synchronize?
hmmm interesting.. I was thinking there might be scenarios where batch would delay the processing but batch within batch might be responsible for the issue I'm seeing, need to get a playground sorted
6 replies