docs: added atom field for sync as an example

{ atoms } -> { atoms: atoms }
This commit is contained in:
duck.__index 2024-06-13 07:42:05 -07:00 • committed by GitHub
parent 8a35fce65d
commit 09e86c0d1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -467,7 +467,7 @@ import { sync } from "@rbxts/charm";
import { remotes } from "./remotes";
import * as atoms from "./atoms";
const server = sync.server({ atoms });
const server = sync.server({ atoms: atoms });
// Broadcast a state update to a specific player
server.connect((player, payload) => {
@ -487,7 +487,7 @@ import { sync } from "@rbxts/charm";
import { remotes } from "./remotes";
import * as atoms from "./atoms";
const client = sync.client({ atoms });
const client = sync.client({ atoms: atoms });
// Listen for incoming state changes from the server
remotes.syncState.connect((payload) => {