Changed lume.once()'s return fn to handle args

This commit is contained in:
rxi 2014-03-03 13:25:53 +00:00
parent c407ef9445
commit 4bb6f24213

View File

@ -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