perf: do not create proxies for iteration

This commit is contained in:
littensy 2025-11-21 19:50:37 -08:00
parent 1206e008a7
commit 9b89284529

View file

@ -900,11 +900,7 @@ local function reactive<T>(initialValue: T & {}): (T, (update: (T) -> () | T?) -
function proxyApi.__iter(self: ReactiveProxy) function proxyApi.__iter(self: ReactiveProxy)
track() track()
local function iterator(target: {}, index: any) return next, self.__target
local key, value = next(target, index)
return key, if type(value) == "table" then createProxy(value) else value
end
return iterator, self.__target
end end
function proxyApi.__len(self: ReactiveProxy) function proxyApi.__len(self: ReactiveProxy)