Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created October 12, 2016 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnthn/81d8ea0aa73c218ee8ff9143db029d75 to your computer and use it in GitHub Desktop.
Save jnthn/81d8ea0aa73c218ee8ff9143db029d75 to your computer and use it in GitHub Desktop.
use Test;
my $source = Supply.interval(0.5);
my $heartbeat = Supply.interval(0.3);
my $s = supply {
my @collected;
whenever $source.zip-latest($heartbeat) {
@collected.push: 'WHENEVER';
if @collected == 10 {
emit @collected;
done;
}
}
}
is await($s.Promise), 'WHENEVER' xx 10;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment