mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 11:44:08 +00:00
fix: send init payload even if atom did not update
This commit is contained in:
parent
079abaacc1
commit
0dbc0587a0
2 changed files with 29 additions and 12 deletions
|
|
@ -6,7 +6,6 @@ type SyncPayload = types.SyncPayload
|
|||
|
||||
local atomRegister: { [string]: Charm.Atom } = {}
|
||||
|
||||
--- @client
|
||||
local function registerAtoms(atoms: { [string]: Charm.Atom })
|
||||
for key, atom in atoms do
|
||||
if atomRegister[key] and atomRegister[key] ~= atom then
|
||||
|
|
@ -18,12 +17,10 @@ local function registerAtoms(atoms: { [string]: Charm.Atom })
|
|||
end
|
||||
end
|
||||
|
||||
--- @client
|
||||
local function clearAtoms()
|
||||
table.clear(atomRegister)
|
||||
end
|
||||
|
||||
--- @client
|
||||
local function unregisterAtoms(...: string)
|
||||
for index = 1, select("#", ...) do
|
||||
local key = select(index, ...)
|
||||
|
|
@ -54,7 +51,6 @@ local function applyPatchPayload(data: { [string | number]: any })
|
|||
end
|
||||
end
|
||||
|
||||
--- @client
|
||||
local function applyPayloads(payloads: { SyncPayload })
|
||||
for _, payload in payloads do
|
||||
if payload.type == "init" then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue