slice: Add documentation.
This commit is contained in:
parent
d7c117619a
commit
78d26ef021
1 changed files with 8 additions and 2 deletions
10
doc/API.md
10
doc/API.md
|
@ -22,7 +22,7 @@
|
||||||
- [push(value) -> async bufferLength](#pushvalue---async-bufferlength)
|
- [push(value) -> async bufferLength](#pushvalue---async-bufferlength)
|
||||||
- [reduce(callbackfn[, initialValue])](#reducecallbackfn-initialvalue)
|
- [reduce(callbackfn[, initialValue])](#reducecallbackfn-initialvalue)
|
||||||
- [shift() -> async](#shift---async)
|
- [shift() -> async](#shift---async)
|
||||||
- [slice(start, end) -> Channel](#slicestart-end---channel)
|
- [slice(start[, end]) -> Channel](#slicestart-end---channel)
|
||||||
- [Functional API](#functional-api)
|
- [Functional API](#functional-api)
|
||||||
|
|
||||||
<!-- /TOC -->
|
<!-- /TOC -->
|
||||||
|
@ -278,7 +278,13 @@ Closed channels always return `undefined` immediately.
|
||||||
The shift can be cancelled before completion by calling `cancel` on the
|
The shift can be cancelled before completion by calling `cancel` on the
|
||||||
returned promise.
|
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
|
# Functional API
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue