Skip to content

Commit ed1342f

Browse files
authored
@std/task: fix documentation generation by renaming taskLib to task (#964)
The documentation generation for `@std/task` is broken, and I believe it is because the table is named `taskLib` and not `task`. We can fix this trivially by renaming it, and that's honestly worth for consistency doing even if it didn't fix the documentation.
1 parent 17d1124 commit ed1342f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lute/std/libs/task.luau

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@
55

66
local lutetask = require("@lute/task")
77

8-
local taskLib = {}
8+
local task = {}
99

1010
--- Schedules `routine` to run immediately on the next resumption cycle, passing any additional arguments to it. Returns the thread.
11-
function taskLib.spawn<T..., U...>(routine: ((T...) -> U...) | thread, ...: T...): thread
11+
function task.spawn<T..., U...>(routine: ((T...) -> U...) | thread, ...: T...): thread
1212
return lutetask.spawn(routine, ...)
1313
end
1414

1515
--- Schedules `routine` to run after the current thread yields, passing any additional arguments to it. Returns the thread.
16-
function taskLib.defer<T..., U...>(routine: ((T...) -> U...) | thread, ...: T...): thread
16+
function task.defer<T..., U...>(routine: ((T...) -> U...) | thread, ...: T...): thread
1717
return lutetask.defer(routine, ...)
1818
end
1919

2020
--- Schedules `routine` to run after `dur` seconds, passing any additional arguments to it. Returns the thread.
21-
function taskLib.delay<T..., U...>(dur: number, routine: ((T...) -> U...) | thread, ...: T...): thread
21+
function task.delay<T..., U...>(dur: number, routine: ((T...) -> U...) | thread, ...: T...): thread
2222
return lutetask.delay(dur, routine, ...)
2323
end
2424

2525
--- Yields the current thread for `dur` seconds (or until the next cycle if `dur` is omitted). Returns the actual time waited.
26-
function taskLib.wait(dur: number?): number
26+
function task.wait(dur: number?): number
2727
return lutetask.wait(dur)
2828
end
2929

3030
--- Cancels `thread`, preventing it from being resumed again.
31-
function taskLib.cancel(thread: thread)
31+
function task.cancel(thread: thread)
3232
coroutine.close(thread)
3333
end
3434

35-
return table.freeze(taskLib)
35+
return table.freeze(task)

0 commit comments

Comments
 (0)