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
| Type | Name | Description |
|---|---|---|
bool | result | true if the promise has not yet been settled, false otherwise |
Examples
local entity = util.promise.create()
core.engine.print("info", entity:is_pending()) -- true
entity:resolve(true)
core.engine.print("info", entity:is_pending()) -- false