Skip to content

Commit

Permalink
show examples too
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 21, 2017
1 parent 3f9f538 commit 6ecf00c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Mojo/Promise.pm
Expand Up @@ -265,12 +265,18 @@ rejects, with the value or reason from that promise.
Reject the promise with one or more rejection reasons.
# Generate rejected promise
my $promise = Mojo::Promise->new->reject('Something went wrong: Oops');
=head2 resolve
$promise = $promise->resolve(@value);
Resolve the promise with one or more fulfillment values.
# Generate fulfilled promise
my $promise = Mojo::Promise->new->resolve('The result is: 24');
=head2 then
my $new = $promise->then(sub {...});
Expand Down

0 comments on commit 6ecf00c

Please sign in to comment.