logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

JavaScript::QuickJS::Promise - JavaScript `Promise` in Perl

Description

       This class represents a JavaScript Promise <https://developer.mozilla.org/en-
       US/docs/Web/JavaScript/Reference/Global_Objects/Promise> instance in Perl.

       This class is not instantiated directly.

Methods

       This exposes then(), catch(), and finally() methods that wrap the JavaScript methods of the same names.

perl v5.40.0                                       2024-10-20                  JavaScript::QuickJS::Promise(3pm)

Name

       JavaScript::QuickJS::Promise - JavaScript `Promise` in Perl

Synopsis

           my $js = JavaScript::QuickJS->new();

           $js->eval("Promise.resolve(123)")->then( sub { CORE::say "resolved: @_" } );

           CORE::say "before await";

           $js->await();

           CORE::say "after await";

See Also