Skip to content

Commit fe2398a

Browse files
author
Jan-Olof Hendig
committed
Added docs for Supply.skip. ugexe++
1 parent 9f60666 commit fe2398a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

doc/Type/Supply.pod6

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,20 @@ Creates a supply that emits a Range every time a new minimum or maximum
555555
values is seen from the given supply. The optional parameter specifies
556556
the comparator, just as with Any.max.
557557
558+
=head2 method skip
559+
560+
method skip(Supply:D: Int(Cool) $number = 1 --> Supply:D)
561+
562+
Returns a new C<Supply> which will emit all values from the given C<Supply>
563+
except for the first C<$number> values, which will be thrown away.
564+
565+
=for code
566+
my $supplier = Supplier.new;
567+
my $supply = $supplier.Supply;
568+
$supply = $supply.skip(3);
569+
$supply.tap({ say $_ });
570+
$supplier.emit($_) for 1..10; # OUTPUT: «4␤5␤6␤7␤8␤9␤10␤»
571+
558572
=head2 method start
559573
560574
method start(Supply:D: &startee --> Supply:D)

0 commit comments

Comments
 (0)