Skip to content

Commit

Permalink
Clarify the docs for when write and end can be used.
Browse files Browse the repository at this point in the history
  • Loading branch information
vqvu committed Apr 4, 2015
1 parent 0c196ca commit 8487ca3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,9 @@ Stream.prototype.resume = function () {
* any [Node Readable Streams](http://nodejs.org/api/stream.html#stream_class_stream_readable)
* you pipe in.
*
* Only call this function on streams that were constructed with no source
* (i.e., with `_()`).
*
* @id end
* @section Stream Objects
* @name Stream.end()
Expand Down Expand Up @@ -1177,6 +1180,9 @@ Stream.prototype.pull = function (f) {
* You shouldn't need to call this yourself, but it may be called by Node
* functions which treat Highland Streams as a [Node Writable Stream](http://nodejs.org/api/stream.html#stream_class_stream_writable).
*
* Only call this function on streams that were constructed with no source
* (i.e., with `_()`).
* @id write
* @section Stream Objects
* @name Stream.write(x)
Expand All @@ -1191,6 +1197,10 @@ Stream.prototype.pull = function (f) {
* xs.toArray(function (ys) {
* // ys will be [1, 2]
* });
*
* // Do *not* do this.
* var xs2 = _().toArray(_.log);
* xs2.write(1); // This call is illegal.
*/

Stream.prototype.write = function (x) {
Expand Down

0 comments on commit 8487ca3

Please sign in to comment.