diff --git a/src/action-queue.lua b/src/action-queue.lua index a268e87..d21edab 100644 --- a/src/action-queue.lua +++ b/src/action-queue.lua @@ -18,8 +18,9 @@ actionQueue = { --- Added actions will be called on every runWaiting() update. --- They will continue to be executed until they return Succeeded or Failed instead of NeedsMoreTime. +--- --- Replaces any existing action with the given name. ---- If the first call of action() doesn't return NeedsMoreTime, will skip adding to the queue. +--- If the initial call of action() doesn't return NeedsMoreTime, this function will not bother adding it to the queue. ---@param name string ---@param maxTimeMs number ---@param action Action @@ -34,7 +35,7 @@ function actionQueue.upsert(self, name, maxTimeMs, action) } end ---- Must call on every playdate.update() to check for (and run) any waiting tasks. +--- Must be called on every playdate.update() to check for (and run) any waiting tasks. --- Actions that return NeedsMoreTime will not be removed from the queue unless they have expired. function actionQueue.runWaiting(self, deltaSeconds) local currentTimeMs = playdate.getCurrentTimeMilliseconds()