NAME

Text::Nunjucks::EmitterObj - the on/emit surface of src/object.js EmitterObj, as a Moo role (ADR 0002)

VERSION

version 0.001

DESCRIPTION

A Moo role giving a class the on / emit pair of Node's EventEmitter, which upstream's EmitterObj extends (ADR 0002). Text::Nunjucks::Loader and Text::Nunjucks::Environment consume it. Only what the engine needs is there: listeners are added with on and called in order by emit; there is no once and no way to remove a listener.

on

$obj->on( $event, sub { my @args = @_; ... } );

Adds a listener for the event and returns the object.

emit

$obj->emit( $event, @args );

Calls every listener of the event with @args, in the order they were added. Returns 1 when there was a listener, 0 when there was none.

SUPPORT

Issues

Please report bugs and feature requests at https://github.com/Getty/p5-text-nunjucks/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <getty@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.