mirror of
https://github.com/TangentFoxy/lume.git
synced 2024-11-19 07:04:24 +00:00
Changed lume.once()'s return fn to handle args
This commit is contained in:
parent
c407ef9445
commit
4bb6f24213
12
lume.lua
12
lume.lua
@ -183,12 +183,12 @@ end
|
||||
|
||||
|
||||
function lume.once(fn, ...)
|
||||
local arg = {...}
|
||||
return function()
|
||||
if arg == nil then return end
|
||||
local rtn = {fn(unpack(arg))}
|
||||
arg = nil
|
||||
return unpack(rtn)
|
||||
local fn = lume.fn(fn, ...)
|
||||
local done = false
|
||||
return function(...)
|
||||
if done then return end
|
||||
done = true
|
||||
return fn(...)
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user