mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 11:44:08 +00:00
fix: refine reactive proxy logic
This commit is contained in:
parent
b3a76face9
commit
b826401bf3
6 changed files with 145 additions and 102 deletions
|
|
@ -102,6 +102,22 @@ test("should replicate partial state patches (reactive)", function()
|
|||
assert(payloads[1].data.a.x == nil, "Expected patch payload to not contain value 'a.x'")
|
||||
end)
|
||||
|
||||
test("should handle nested proxies", function()
|
||||
local client = {}
|
||||
local src = Charm.reactive({ (Charm.reactive({})) })
|
||||
local payloads: {}? = nil
|
||||
|
||||
server.addSignalsToClient(client, { src = src })
|
||||
server.connect(function(_, newPayloads)
|
||||
payloads = newPayloads
|
||||
end)
|
||||
server.flush()
|
||||
|
||||
payloads = nil
|
||||
server.flush()
|
||||
assert(payloads == nil, "Expected no payloads to be sent for unchanged nested proxy")
|
||||
end)
|
||||
|
||||
test("should init new clients", function()
|
||||
local clientA = {}
|
||||
local clientB = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue