Created
January 6, 2025 21:55
-
-
Save patrickbkr/8af931a8952dd573ad90379442dabaf7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $s1 = supply { emit 1; emit 2 } | |
my $s2 = supply { emit 0 } | |
my $s3 = supply { whenever $s1 { | |
if $_ == 1 { | |
whenever $s2 { emit $_; } | |
} | |
else { emit $_; } | |
} | |
} | |
react whenever $s3 { say $_ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment