Add special case for frozen tables

Sources will now check if frozen tables are equal before updating
dependencies.
This commit is contained in:
aaron 2023-08-12 11:11:21 +01:00
parent 744cce0fb6
commit afd863285b
3 changed files with 23 additions and 1 deletions

View file

@ -15,7 +15,7 @@ local function source<T>(value: T): Source<T>
if select("#", ...) == 0 then return get_value() end
local v = ... :: T
if node.cache == v and type(v) ~= "table" then return v end
if node.cache == v and (type(v) ~= "table" or table.isfrozen(v)) then return v end
set(node, v)
return v