How to get the state of a promise ?

Hello, I am using promises library in my shiny app. I want to display 'loading' while promise is pending. In order to do that, I need to know if a promise is pending or fulfilled. If I would use future library, I could access the state of the future by accessing state value of the object like this:

g <- future(expr = {Sys.sleep(30);"done!"})
[1] "running"

So how can i do the same thing for a promise object?
Here is an example promise object:

g <- future_promise(expr = {Sys.sleep(30);"done!"})

If i call g on console I get this result

<Promise [pending]>

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.