ndyg
ndyg
SSolidJS
Created by ndyg on 2/15/2024 in #support
understanding store setter updates
In this example:
import { produce } from "solid-js/store"

// without produce
setStore("users", 0, "username", "newUsername")
setStore("users", 0, "location", "newLocation")

// with produce
setStore(
"users",
0,
produce((user) => {
user.username = "newUsername"
user.location = "newLocation"
})
)
import { produce } from "solid-js/store"

// without produce
setStore("users", 0, "username", "newUsername")
setStore("users", 0, "location", "newLocation")

// with produce
setStore(
"users",
0,
produce((user) => {
user.username = "newUsername"
user.location = "newLocation"
})
)
for the "without produce" case, would two dependency updates be triggered?
9 replies