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)
return self
end
local function delete(self)
world:delete(e)
end
local function id()
return e
end

View file

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