Sam Kennedy Hine
Sam Kennedy Hine
Explore posts from servers
SSolidJS
Created by Sam Kennedy Hine on 10/23/2023 in #support
setStore odd creation behavior
Hey there team, thanks for your input, produce did work, however @aryzing suggestion to revert to old method of wrapping array in object has worked very cleanly and getting expected results. Issue must have been to do with the managling of the topline proxy and not getting proper reactivity. Would still love to understand why I was getting duplications, but that may be for another day!
11 replies
SSolidJS
Created by Sam Kennedy Hine on 10/23/2023 in #support
setStore odd creation behavior
Edit3: Finally found a work around. Based on an old request on this forum. I am absolutely sure this is not the way to do this correctly, and have no idea why this is working when nothing else would, but it does work for now. unfortunately with a very ugly type error. Would love any feedback on how to do this in a more intuitive way if anyone has any time!
const filter = tasks.findIndex(t=>t.id==id)
setTasks(produce(v=>v.splice(filter,1)))
const filter = tasks.findIndex(t=>t.id==id)
setTasks(produce(v=>v.splice(filter,1)))
11 replies
SSolidJS
Created by Sam Kennedy Hine on 10/23/2023 in #support
setStore odd creation behavior
Edit2: I've since added an id system so I could attempt to follow some of the resources around. No such luck unfortunately. Current best attempt at removing an elements:
setTasks((i)=>i.filter(t=>t.id !== id))
setTasks((i)=>i.filter(t=>t.id !== id))
11 replies
SSolidJS
Created by Sam Kennedy Hine on 10/23/2023 in #support
setStore odd creation behavior
Edit1: trying to get to the bottom of this I recreated the app in the js playgroup and have a beautiful working delete function...?!? baffled! https://playground.solidjs.com/anonymous/ab166bfd-5a55-4df5-81d4-6383b6ec4141
11 replies
SSolidJS
Created by Sam Kennedy Hine on 12/23/2022 in #support
how to await createResource?
const X = d3.map(data(), (d: gameData) => d.end_time * 1000 ).filter(x => x !== undefined);
const X = d3.map(data(), (d: gameData) => d.end_time * 1000 ).filter(x => x !== undefined);
specifically in the above data() is throwing a type error, as expected, I'm looking for a way to ensure that data() not undefined before I start using its values.
6 replies
SSolidJS
Created by Sam Kennedy Hine on 12/23/2022 in #support
how to await createResource?
I understand that, I guess my question more directly is how do I effectivly handle undefined state in my typescript code so I can do computations with a createResource
6 replies