syncing dont work!!

i set up syncing with cahrm-sync but when i change server atom nothing happens! sync:connect() dont fire and subscriptions to server atom too
server
server
No description
Solution:
charm is immutable, u should clone the tables before writing data in your updater function
Jump to solution
14 Replies
Unknown User
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
wAD
wAD•3mo ago
where is your atom actually being changed
Tverksaac 2.0
Tverksaac 2.0OP•3mo ago
yes ofc when other class is created my server atom changes, if i print it later anywhere atom's state is changed too, but subscriptions and then connection dont get called
wAD
wAD•3mo ago
show code
Tverksaac 2.0
Tverksaac 2.0OP•3mo ago
this func get called and here output in game, it prints SYNCING... when syncer.connect on server gets called, so it gets called only once when hydrated and then nothing
No description
No description
Tverksaac 2.0
Tverksaac 2.0OP•3mo ago
here
wAD
wAD•3mo ago
state mutation
Tverksaac 2.0
Tverksaac 2.0OP•3mo ago
what?😃
wAD
wAD•3mo ago
ur mutating the state that's the issue
Tverksaac 2.0
Tverksaac 2.0OP•3mo ago
ima go read charm docs then i dont understand what ur talking about thanks!! i cant change server atom's state anywhere except where it was created?
wAD
wAD•3mo ago
no
Solution
wAD
wAD•3mo ago
charm is immutable, u should clone the tables before writing data in your updater function
wAD
wAD•3mo ago
might as well use spreading syntax
Tverksaac 2.0
Tverksaac 2.0OP•3mo ago
oooooohh i see tysmm it worked!!

Did you find this page helpful?