mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 19:54:09 +00:00
fix(charm-sync): warn if attempting to sync non-registered signal on the client
This commit is contained in:
parent
2fc3be34d0
commit
aa84fa1e3d
1 changed files with 4 additions and 0 deletions
|
|
@ -64,6 +64,8 @@ local function applyInitPayload(data: { [string]: any })
|
||||||
trackedSignals[key](value)
|
trackedSignals[key](value)
|
||||||
elseif trackedReactives[key] then
|
elseif trackedReactives[key] then
|
||||||
shallowMergeReactive(trackedReactives[key], value)
|
shallowMergeReactive(trackedReactives[key], value)
|
||||||
|
else
|
||||||
|
warn(`charm-sync failed to sync key '{key}' because it is not currently registered by addSignals()`)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -80,6 +82,8 @@ local function applyPatchPayload(data: { [string]: any })
|
||||||
elseif trackedReactive then
|
elseif trackedReactive then
|
||||||
patch.applyMutable(trackedReactive.__target, diffs)
|
patch.applyMutable(trackedReactive.__target, diffs)
|
||||||
Charm.trigger(trackedReactive.__track)
|
Charm.trigger(trackedReactive.__track)
|
||||||
|
else
|
||||||
|
warn(`charm-sync failed to sync key '{key}' because it is not currently registered by addSignals()`)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue