mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-24 17:10:03 +00:00
Remove key
Remove e
This commit is contained in:
parent
a4fe3b29d1
commit
5476d86e57
2 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue