Plugin::HTMX;
use Mojo::Base 'Mojolicious::Plugin';
use Mojo::ByteStream;
use Mojo::JSON qw(encode_json decode_json);
use Mojo::Util qw(xml_escape);
our $VERSION = '1.03';
my @HX_RESWAPS = (qw[
r') });
$app->helper(
'htmx.req.triggering_event' => sub {
eval { decode_json(_header(shift, 'Triggering-Event')) } || {};
}
);
$app->helper(
'htmx.re
return undef unless $location;
if (ref $location eq 'HASH') {
$location = encode_json($location);
}
return $c->res->headers->header('HX-Location' => $location);
}
sub _res_