Skip to content

Commit

Permalink
Merge pull request #485 from mhelvens/patch-1
Browse files Browse the repository at this point in the history
Clarify the `fromBinder` documentation w.r.t. `Bacon.noMore`
  • Loading branch information
raimohanska committed Dec 5, 2014
2 parents c7f321d + b7e0623 commit e04ee87
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,18 @@ As shown in the example, you can push
stream end).
- An array of event objects at once

See another [example](http://jsfiddle.net/PG4c4/).

The subscribe function must return a function. Let's call that function
`unsubscribe`. The returned function can be used by the subscriber to
unsubscribe and it should release all resources that the subscribe function reserved.

The `sink` function may return [`Bacon.more`](#bacon-more) or [`Bacon.noMore`](#bacon-nomore). It may also
return undefined or anything else. Iff it returns [`Bacon.noMore`](#bacon-nomore), the subscriber
must be cleaned up just like in case of calling the `unsubscribe` function.
Other examples can be found on [JSFiddle](http://jsfiddle.net/PG4c4/) and the
[Bacon.js blog](http://baconjs.blogspot.fi/2013/12/wrapping-things-in-bacon.html).

The `subscribe` function must return a function. Let's call that function
`unsubscribe`. The returned function can be used by the subscriber (directly or indirectly) to
unsubscribe from the EventStream. It should release all resources that the subscribe function reserved.

The `sink` function may return [`Bacon.noMore`](#bacon-nomore) (as well as [`Bacon.more`](#bacon-more)
or any other value). If it returns [`Bacon.noMore`](#bacon-nomore), no further events will be consumed
by the subscriber. The `subscribe` function may choose to clean up all resources at this point (e.g.,
by calling `unsubscribe`). This is usually not necessary, because further calls to `sink` are ignored,
but doing so can increase performance in [rare cases](https://github.com/baconjs/bacon.js/issues/484).

The EventStream will wrap your `subscribe` function so that it will
only be called when the first stream listener is added, and the `unsubscribe`
Expand Down
21 changes: 12 additions & 9 deletions readme-src.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,18 @@ As shown in the example, you can push
stream end).
- An array of event objects at once
See another [example](http://jsfiddle.net/PG4c4/).
The subscribe function must return a function. Let's call that function
`unsubscribe`. The returned function can be used by the subscriber to
unsubscribe and it should release all resources that the subscribe function reserved.
The `sink` function may return `Bacon.more` or `Bacon.noMore`. It may also
return undefined or anything else. Iff it returns `Bacon.noMore`, the subscriber
must be cleaned up just like in case of calling the `unsubscribe` function.
Other examples can be found on [JSFiddle](http://jsfiddle.net/PG4c4/) and the
[Bacon.js blog](http://baconjs.blogspot.fi/2013/12/wrapping-things-in-bacon.html).
The `subscribe` function must return a function. Let's call that function
`unsubscribe`. The returned function can be used by the subscriber (directly or indirectly) to
unsubscribe from the EventStream. It should release all resources that the subscribe function reserved.
The `sink` function may return [`Bacon.noMore`](#bacon-nomore) (as well as [`Bacon.more`](#bacon-more)
or any other value). If it returns [`Bacon.noMore`](#bacon-nomore), no further events will be consumed
by the subscriber. The `subscribe` function may choose to clean up all resources at this point (e.g.,
by calling `unsubscribe`). This is usually not necessary, because further calls to `sink` are ignored,
but doing so can increase performance in [rare cases](https://github.com/baconjs/bacon.js/issues/484).
The EventStream will wrap your `subscribe` function so that it will
only be called when the first stream listener is added, and the `unsubscribe`
Expand Down

0 comments on commit e04ee87

Please sign in to comment.