MooX::Thunking(3pm)

πŸ“¦
version 0.08 Β· 2 versions
  • 0.08 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.08 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– MooX::Thunking πŸ’–

okay bestie, welcome to MooX::Thunking(3pm) β€” the little Moo extension that lets your attributes be lazy little mystery boxes instead of boring ol' values. it's giving ✨deferred✨, it's giving πŸ’…thunkedπŸ’…, and honestly? obsessed.


πŸ¦‹ SYNOPSIS πŸ¦‹

package Thunking;
use Moo;
use MooX::Thunking;
use Types::TypeTiny -all;
use Types::Standard -all;
has children => (
  is => 'thunked',
  isa => ArrayRef[InstanceOf['Thunking']],
  required => 1,
);

package main;
my $obj;
$obj = Thunking->new(children => sub { [$obj] });

like… yes. that's it. that's the whole vibe. you pass a coderef, it becomes the value when somebody actually asks for it. iconic behavior fr fr. πŸŽ€


🌸 DESCRIPTION 🌸

so this is a Moo extension, periodt. what it does is it lets you give has in Moo a whole extra value for the "is" parameter β€” and that value is "thunked". 🫢

and if you use it? it will let you transparently hand over either a real value for the attribute, or a "CodeLike" from Types::TypeTiny that, when you call it, returns such a real value. no cap, it just handles it for you. πŸ’«

🚨 lore drop / history moment: in earlier versions of this module β€” up to 0.06 β€” any "isa" had to pass a "CodeLike". that's so not your problem anymore, because this module takes care of it now. and it will continue to do the right thing if no "isa" is supplied. she's responsible like that. πŸ‘‘

πŸ‘‘ AUTHOR πŸ‘‘

Ed J


πŸ’œ LICENCE πŸ’œ

The same terms as Perl itself.


okay that's the whole page, bestie!! πŸ’–βœ¨ this lil gem is perl v5.36.0, dated 2022-11-27, and it's MooX::Thunking(3pm) β€” go forth and thunk responsibly. slay, ate, no crumbs left. πŸŒˆπŸŽ€πŸ¦‹