Remove key

Remove e
This commit is contained in:
Ukendio 2024-09-06 01:04:52 +02:00
parent a4fe3b29d1
commit 5476d86e57
2 changed files with 5 additions and 2 deletions

View file

@ -31,6 +31,9 @@ do
world:clear(e) world:clear(e)
return self return self
end end
local function delete(self)
world:delete(e)
end
local function id() local function id()
return e return e
end end

View file

@ -2,7 +2,7 @@ local world = require(script.Parent.world)
local handle = require(script.Parent.handle) local handle = require(script.Parent.handle)
local refs = {} local refs = {}
local function fini(e, key) local function fini(key)
return function() return function()
refs[key] = nil refs[key] = nil
end end
@ -18,7 +18,7 @@ local function ref(key): (handle.Handle, (() -> ())?)
refs[key] = e refs[key] = e
end end
-- Cannot cache handles because they will get invalidated -- Cannot cache handles because they will get invalidated
return handle(e), fini(e, key) return handle(e), fini(key)
end end
return ref return ref