method keep

Documentation for method keep, assembled from the following types:

class Promise

From Promise

(Promise) method keep

multi method keep(Promise:D:)
multi method keep(Promise:D: \result)

Keeps a promise, optionally setting the result. If no result is passed, the result will be True.

Throws an exception of type X::Promise::Vowed if a vow has already been taken. See method vow for more information.

my $p = Promise.new;
 
if Bool.pick {
    $p.keep;
}
else {
     $p.break;
}