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
|
|
@ -36,9 +36,9 @@ end
|
|||
]]
|
||||
local function toRaw<T>(value: T): T
|
||||
if isReactive(value) then
|
||||
value = value :: ReactiveProxy<T>
|
||||
value.__track()
|
||||
return toRaw(value.__target)
|
||||
local proxy = value :: ReactiveProxy<T>
|
||||
proxy.__track()
|
||||
return toRaw(proxy.__target)
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
|
@ -115,7 +115,7 @@ end
|
|||
@return A reactive proxy if the value is a table
|
||||
]]
|
||||
local function toReactive<T>(value: T, trackParent: (() -> ())?): T
|
||||
return if type(value) == "table" then reactive(value, trackParent) else value
|
||||
return if type(value) == "table" then reactive(value, trackParent) :: T else value :: T
|
||||
end
|
||||
|
||||
function ReactiveProxy.__index(self: ReactiveProxy, key: any): any
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue