slice: Add documentation.

This commit is contained in:
David Braun 2017-10-17 10:34:31 -04:00
parent d7c117619a
commit 78d26ef021

View file

@ -22,7 +22,7 @@
- [push(value) -> async bufferLength](#pushvalue---async-bufferlength)
- [reduce(callbackfn[, initialValue])](#reducecallbackfn-initialvalue)
- [shift() -> async](#shift---async)
- [slice(start, end) -> Channel](#slicestart-end---channel)
- [slice(start[, end]) -> Channel](#slicestart-end---channel)
- [Functional API](#functional-api)
<!-- /TOC -->
@ -278,7 +278,13 @@ Closed channels always return `undefined` immediately.
The shift can be cancelled before completion by calling `cancel` on the
returned promise.
### slice(start, end) -> Channel
### slice(start[, end]) -> Channel
Return a new channel generated by skipping `start` number of values. If `end`
is provided then close the new channel after `end` - `start` values have been
pushed.
Unlike in `Array`'s method, `start` and `end` cannot be negative.
# Functional API