Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the fromBinder documentation w.r.t. Bacon.noMore #485

Merged
merged 4 commits into from
Dec 5, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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