Hi! I'm having issue updating a single schema. The only example I found was about MapSchema or ArraySchema. I'm trying to replicate the logic for a single schema created in the StateHandler and It does not seems to work. I'm not having any issue with the MapSchema Update and ArraySchema update... only with the single Schema. What am I doing wrong?
Update simple schema (Solved)
hey @Rangerz132, welcome!
onAdd
is only called for "collections" of items, you could attach the onChange
callback directly on it:
this.room.state.mole.onChange = (changes) => {};
Alternatively, I'd suggest using .listen()
instead:
this.room.state.mole.listen("x", (value) => {})
this.room.state.mole.listen("y", (value) => {})