| as.promise.mirai | R Documentation |
Creates a 'promise' from a 'mirai'. S3 method for promises::as.promise().
## S3 method for class 'mirai'
as.promise(x)
x |
(mirai) object to convert to promise. |
Allows a 'mirai' to be used with the promise pipe %...>%, scheduling a
function to run upon resolution.
Requires the promises package.
A 'promise' object.
library(promises)
p <- as.promise(mirai("example"))
print(p)
is.promise(p)
p2 <- mirai("completed") %...>% identity()
p2$then(cat)
is.promise(p2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.