mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 03:36:11 +00:00
perf: do not create proxies for iteration
This commit is contained in:
parent
1206e008a7
commit
9b89284529
1 changed files with 1 additions and 5 deletions
|
|
@ -900,11 +900,7 @@ local function reactive<T>(initialValue: T & {}): (T, (update: (T) -> () | T?) -
|
|||
|
||||
function proxyApi.__iter(self: ReactiveProxy)
|
||||
track()
|
||||
local function iterator(target: {}, index: any)
|
||||
local key, value = next(target, index)
|
||||
return key, if type(value) == "table" then createProxy(value) else value
|
||||
end
|
||||
return iterator, self.__target
|
||||
return next, self.__target
|
||||
end
|
||||
|
||||
function proxyApi.__len(self: ReactiveProxy)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue