self:is_pending

Shared

Checks whether the promise is still in a pending state


Syntax

local result = self:is_pending()

Parameters

No parameters are accepted by this function

Returns

TypeNameDescription
boolresulttrue if the promise has not yet been settled, false otherwise

Examples

Check whether a promise is still pending
local entity = util.promise.create()

core.engine.print("info", entity:is_pending()) -- true

entity:resolve(true)
core.engine.print("info", entity:is_pending()) -- false

On this page