mirror of
https://github.com/littensy/charm.git
synced 2026-10-20 17:51:37 +00:00
fix: resolve type errors for new luau version
Some checks are pending
CI / analyze (push) Waiting to run
Some checks are pending
CI / analyze (push) Waiting to run
This commit is contained in:
parent
b05f3a9de6
commit
73fbfb2685
6 changed files with 13 additions and 13 deletions
|
|
@ -39,10 +39,10 @@ local syncCallback: ((client: any, payloads: { SyncPayload }) -> ())?
|
|||
support custom implementations of reactive proxies.
|
||||
]]
|
||||
local function toRaw<T>(value: T): T
|
||||
value = value :: types.ReactiveProxy<T>
|
||||
if type(value) == "table" and type(value.__target) == "table" and type(value.__track) == "function" then
|
||||
value.__track()
|
||||
return toRaw(value.__target)
|
||||
local proxy = value :: types.ReactiveProxy<T>
|
||||
if type(proxy) == "table" and type(proxy.__target) == "table" and type(proxy.__track) == "function" then
|
||||
proxy.__track()
|
||||
return toRaw(proxy.__target)
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ test("should flatten functions", function()
|
|||
local input = {
|
||||
a = Charm.atom(0),
|
||||
b = { c = Charm.atom(0) },
|
||||
d = { e = { f = utils.signalToAtom(Charm.signal(0)) } },
|
||||
d = { e = { f = utils.signalToAtom<<number>>(Charm.signal(0)) } },
|
||||
}
|
||||
|
||||
local result = utils.flatten<<{ [string]: Charm.Atom<number> }>>(input)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue