Skip to content

Instantly share code, notes, and snippets.

@Mullets-Gavin
Created March 1, 2021 22:46
Show Gist options
  • Save Mullets-Gavin/6b3608f40d2df18f8afd8d608af91abb to your computer and use it in GitHub Desktop.
Save Mullets-Gavin/6b3608f40d2df18f8afd8d608af91abb to your computer and use it in GitHub Desktop.
Executor Class
local Executer = {} do
Executer.__index = Executer
function Executer.new(callback)
return setmetatable({
callback = callback,
}, Executer)
end
function Executer:Destroy()
self.callback()
end
function Executer:Disconnect()
self.callback()
end
function Executer:__call(callback)
return self.new(callback)
end
Executer = setmetatable(Executer, Executer)
end
return Executer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment