From 955a757df527d6f592862d14f145d11026b9a200 Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 7 Jul 2024 01:52:08 -0700 Subject: [PATCH] docs: add check for payload type --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c421167..42c49ba 100644 --- a/README.md +++ b/README.md @@ -420,8 +420,8 @@ import { sync } from "@rbxts/charm"; const server = sync.server({ atoms: atomsToSync }); server.connect((player, payload) => { - if (sync.isNone(payload.data.todosAtom?.eggs)) { - // 'eggs' will be removed from the client's todo list + if (payload.type === "patch" && sync.isNone(payload.data.todosAtom?.eggs)) { + // 'eggs' will be removed from the client's todos atom } remotes.syncState.fire(player, payload); });