This commit is contained in:
hrsh7th
2021-10-16 13:27:36 +09:00
parent 5fe7dc1eea
commit ebe040b1a9
7 changed files with 32 additions and 21 deletions

View File

@@ -1,5 +1,19 @@
local misc = {}
---Create once callback
---@param callback function
---@return function
misc.once = function(callback)
local done = false
return function()
if done then
return
end
done = true
callback()
end
end
---Return concatenated list
---@param list1 any[]
---@param list2 any[]