We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
wait
1 parent bad4edb commit 1cf4596Copy full SHA for 1cf4596
lua/async.lua
@@ -140,12 +140,13 @@ end
140
--- @tparam function func callback style function to execute
141
--- @tparam any ... Arguments for func
142
function M.wait(...)
143
- if type(select(1, ...)) == 'number' then
+ if type(...) == 'number' then
144
return wait(...)
145
+ else
146
+ -- Assume argc is equal to the number of passed arguments + 1 for callback.
147
+ local nargs = select('#', ...)
148
+ return wait(nargs + 1, ...)
149
end
-
- -- Asume argc is equal to the number of passed arguments.
- return wait(select('#', ...) - 1, ...)
150
151
152
--- Use this to create a function which executes in an async context but
0 commit comments