From 78d26ef0217811c43df7bd296706308cb29794e8 Mon Sep 17 00:00:00 2001 From: David Braun Date: Tue, 17 Oct 2017 10:34:31 -0400 Subject: [PATCH] slice: Add documentation. --- doc/API.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/API.md b/doc/API.md index 978911f..9929a95 100644 --- a/doc/API.md +++ b/doc/API.md @@ -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) @@ -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