We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 592e4a5 commit c1510f6Copy full SHA for c1510f6
doc/Type/Supply.pod
@@ -217,6 +217,21 @@ Creates an on-demand supply from the values passed to this method.
217
$s.tap(&say); # 1\n2\n3\n
218
$s.done;
219
220
+=head2 method share
221
+
222
+ method share(Supply:D:) returns Supply:D
223
224
+ my $s = Supply.from-list(^100000).share;
225
+ my @first;
226
+ $s.tap: { @first.push($_) };
227
+ my @second;
228
+ $s.tap: { @second.push($_) };
229
+ say @first + @second;
230
231
+Creates a live supply from an on-demand supply, thus making it possible to
232
+share the values of the on-demand supply on multiple taps, instead of each
233
+tap seeing all values from the on-demand supply.
234
235
=head2 method flat
236
237
method flat(Supply:D:) returns Supply:D
0 commit comments