Creates a 'promise' from a 'mirai_map'.
Usage
# S3 method for class 'mirai_map'
as.promise(x)
Details
This function is an S3 method for the generic as.promise()
for class
'mirai_map'.
Requires the promises package.
Allows a 'mirai_map' to be used with the promise pipe %...>%
, which
schedules a function to run upon resolution of the entire 'mirai_map'.
The implementation internally uses promises::promise_all()
. If all of the
promises were successful, the returned promise will resolve to a list of the
promise values; if any promise fails, the first error to be encountered will
be used to reject the returned promise.