Skip to main content

PromiseMaidUtils

Helper functions for maids and promises

Functions

whilePromise

PromiseMaidUtils.whilePromise(
promisePromise.Promise<T...>,
callback((Maid.Maid) → ())?
) → Maid.Maid

Calls the callback with a maid for the lifetime of the promise.

local promise = Promise.delay(5)
PromiseMaidUtils.whilePromise(promise, function(maid)
	-- Do work while the promise is pending
end)
Show raw api
{
    "functions": [
        {
            "name": "whilePromise",
            "desc": "Calls the callback with a maid for the lifetime of the promise.\n\n```lua\nlocal promise = Promise.delay(5)\nPromiseMaidUtils.whilePromise(promise, function(maid)\n\t-- Do work while the promise is pending\nend)\n```",
            "params": [
                {
                    "name": "promise",
                    "desc": "",
                    "lua_type": "Promise.Promise<T...>"
                },
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "((Maid.Maid) -> ())?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Maid.Maid\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 25,
                "path": "src/promisemaid/src/Shared/PromiseMaidUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PromiseMaidUtils",
    "desc": "Helper functions for maids and promises",
    "source": {
        "line": 7,
        "path": "src/promisemaid/src/Shared/PromiseMaidUtils.lua"
    }
}