gubsey
gubsey
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
Oh yea I get that. That's the whole point though, in rust you always know when you are access by value or by reference. There is never any ambiguity. It seems like every problem I have with javascript comes from not knowing.
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
I wish you the best of luck. I've been building my entire backend with axum and I dread ever having to use js. You've made it much easier😅
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
I miss ownership and borrowing
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
Coming from the rust world, these equality rules are still so strange to me
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
right yea
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
I don't really understand referential equality, but I'm guessing it's similar to the == vs === distinction
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
oh I see what you did
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
also this syntax is beautiful updateGrid(y, x, p => !p)
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
Any idea why a store works but a signal doesn't?
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
Thanks! I appreciate you guys!
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
but none of the other method's were working...
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
Yea that's not wrong...
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
return (
<table>
<tbody>
{grid().map((row, y) => (
<tr>
{row.map((cell, x) => (
<td
class={`${cell ? "bg-green-500" : 'bg-red-500'} w-8 h-8 border border-separate`}
onclick={_ => flip(x, y)}></td>
))}
</tr>
))}
</tbody>
</table>
)
return (
<table>
<tbody>
{grid().map((row, y) => (
<tr>
{row.map((cell, x) => (
<td
class={`${cell ? "bg-green-500" : 'bg-red-500'} w-8 h-8 border border-separate`}
onclick={_ => flip(x, y)}></td>
))}
</tr>
))}
</tbody>
</table>
)
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
changed every <For> to arr.map
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
this worked!
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
I'll look into stores
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
this also didn't work
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
It just isn't reflecting those changes in the render
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
It's definitely changing grid
47 replies
SSolidJS
Created by gubsey on 6/23/2023 in #support
Signals not updating in <For> tag
const flip = (x: number, y: number) => {
let val = grid();
val[y][x] = !val[y][x]
updateGrid([...val])
}
const flip = (x: number, y: number) => {
let val = grid();
val[y][x] = !val[y][x]
updateGrid([...val])
}
47 replies