dnd5e reactivity with race.advancement.byID
I'm having trouble when fetching a race
byUuid
with one particular reactive var:
Any ideas? Why adv
is undefined?
(The only special thing about byId
is that it's a getter)3 Replies
Likely because the reactive statement for
$: adv
doesn't get run immediately after race is set.
You can put console log statements in the reactive statements to debug.I put a timeout on it and then it gets set, so you're right, race condition. Cool tx.
Or put a
tick()
; after race =
in selectHandler
.
import { tick } from 'svelte';
await tick();