mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 03:36:11 +00:00
feat: add sync validation
This commit is contained in:
parent
23dc1ad855
commit
d8d0c2a1f8
5 changed files with 166 additions and 0 deletions
|
|
@ -1,3 +1,5 @@
|
|||
local validate = require(script.Parent.validate)
|
||||
|
||||
local NONE = { __none = "__none" }
|
||||
|
||||
local function diff(previousState: { [any]: any }, nextState: { [any]: any })
|
||||
|
|
@ -15,6 +17,15 @@ local function diff(previousState: { [any]: any }, nextState: { [any]: any })
|
|||
end
|
||||
end
|
||||
|
||||
if _G.__DEV__ then
|
||||
for key, value in previousState do
|
||||
validate(value, key, warn)
|
||||
end
|
||||
for key, value in nextState do
|
||||
validate(value, key, warn)
|
||||
end
|
||||
end
|
||||
|
||||
return patch
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue