mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 03:36:11 +00:00
feat: add signal api
This commit is contained in:
parent
bf92413a97
commit
1e0b10aef6
21 changed files with 300 additions and 293 deletions
|
|
@ -3,7 +3,7 @@ local config = require("./config")
|
|||
local types = require("./types")
|
||||
local validate = require("./validate")
|
||||
|
||||
local flags = Charm.flags
|
||||
local globals = Charm.globals
|
||||
|
||||
export type None = types.None
|
||||
|
||||
|
|
@ -73,13 +73,13 @@ local function diff(currentState: any, nextState: any): any
|
|||
patches[key] = diff(previous, nextState[key])
|
||||
end
|
||||
|
||||
if config.autoSerialize then
|
||||
if config.fixArrays then
|
||||
-- Coerce sparse array patches into dictionaries
|
||||
if currentState[1] ~= nil or nextState[1] ~= nil then
|
||||
patches = stringifySparseArray(patches)
|
||||
end
|
||||
|
||||
if flags.strict and config.validatePatches then
|
||||
if globals.strict and config.validatePatches then
|
||||
for key, value in patches do
|
||||
validate(value, key)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue