mirror of
https://github.com/littensy/charm.git
synced 2026-10-23 13:54:07 +00:00
docs: added atom field for sync as an example
{ atoms } -> { atoms: atoms }
This commit is contained in:
parent
8a35fce65d
commit
09e86c0d1e
1 changed files with 2 additions and 2 deletions
|
|
@ -467,7 +467,7 @@ import { sync } from "@rbxts/charm";
|
||||||
import { remotes } from "./remotes";
|
import { remotes } from "./remotes";
|
||||||
import * as atoms from "./atoms";
|
import * as atoms from "./atoms";
|
||||||
|
|
||||||
const server = sync.server({ atoms });
|
const server = sync.server({ atoms: atoms });
|
||||||
|
|
||||||
// Broadcast a state update to a specific player
|
// Broadcast a state update to a specific player
|
||||||
server.connect((player, payload) => {
|
server.connect((player, payload) => {
|
||||||
|
|
@ -487,7 +487,7 @@ import { sync } from "@rbxts/charm";
|
||||||
import { remotes } from "./remotes";
|
import { remotes } from "./remotes";
|
||||||
import * as atoms from "./atoms";
|
import * as atoms from "./atoms";
|
||||||
|
|
||||||
const client = sync.client({ atoms });
|
const client = sync.client({ atoms: atoms });
|
||||||
|
|
||||||
// Listen for incoming state changes from the server
|
// Listen for incoming state changes from the server
|
||||||
remotes.syncState.connect((payload) => {
|
remotes.syncState.connect((payload) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue