Skip to content

Instantly share code, notes, and snippets.

@arumons
Created May 30, 2012 00:32
Show Gist options
  • Select an option

  • Save arumons/2831688 to your computer and use it in GitHub Desktop.

Select an option

Save arumons/2831688 to your computer and use it in GitHub Desktop.
serial
function serial(callbacks)
local i = 1
local next
next = function()
i = i + 1
local f = callbacks[i]
if f then
f(next)
end
end
callbacks[1](next)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment