fix: wrap hooks in untracked, update types

This commit is contained in:
littensy 2025-10-02 19:30:40 -07:00
parent 1657e2cb74
commit 87e7260c16
5 changed files with 40 additions and 16 deletions

View file

@ -115,7 +115,7 @@ export namespace client {
export function reset(): void;
export function applyPayloads<Atoms extends { [key: string]: Atom<any> }, Serialize extends boolean>(
export function applyPayloads<Atoms extends { [key: string]: Atom<any> }, Serialize extends boolean = true>(
payloads: SyncPayload<Atoms, Serialize>[],
): void;
}
@ -127,8 +127,8 @@ export namespace server {
export function unsyncClient(client: Player): void;
export function startSync<Atoms extends { [key: string]: Atom<any> }, Serialize extends boolean>(
onSync: (client: Player, payload: SyncPayload<Atoms, Serialize>) => void,
export function startSync<Atoms extends { [key: string]: Atom<any> }, Serialize extends boolean = true>(
onSync: (client: Player, payloads: SyncPayload<Atoms, Serialize>[]) => void,
): Cleanup;
export function stopSync(): void;

View file

@ -301,7 +301,7 @@ local function startSync(onSync: (client: any, payloads: { SyncPayload }) -> ())
timer += deltaTime
if timer >= config.interval then
timer %= config.interval
timer = 0
debug.profilebegin("CharmSync")
flush()
debug.profileend()