Skip to content

Commit

Permalink
Update sequence.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
britzl committed Aug 12, 2019
1 parent 7a0c58b commit 99cb295
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ludobits/m/sequence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ function M.delay(seconds)
coroutine.yield()
end

function M.wait_until_false(fn, ...)
function M.wait_until_false(fn)
local co = coroutine.running()
timer.delay(0, true, function(self, handle, time_elapsed)
if not fn(...) then
if not fn() then
timer.cancel(handle)
coroutine.resume(co)
end
end)
coroutine.yield()
end

function M.wait_until_true(fn, ...)
function M.wait_until_true(fn)
local co = coroutine.running()
timer.delay(0, true, function(self, handle, time_elapsed)
if fn(...) then
if fn() then
timer.cancel(handle)
coroutine.resume(co)
end
Expand Down

0 comments on commit 99cb295

Please sign in to comment.