Skip to content

Commit

Permalink
chore(package): release new version
Browse files Browse the repository at this point in the history
  • Loading branch information
staltz committed Jul 22, 2016
1 parent 714dd01 commit 1adc780
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
<a name="5.3.0"></a>
# [5.3.0](https://github.com/staltz/xstream/compare/v5.2.4...v5.3.0) (2016-07-22)


### Features

* **fromEvent:** Aggregate multiple arguments ([714dd01](https://github.com/staltz/xstream/commit/714dd01)), closes [staltz/xstream#84](https://github.com/staltz/xstream/issues/84) [#89](https://github.com/staltz/xstream/issues/89)


### BREAKING CHANGES

* fromEvent: .
2. An expanded function signature would become 'crowded', and one of
the architectural goals of xstream is to keep interfaces as small
as they need to be to achieve their goals.
3. Aggregating emitted events into an array is consistent with the
implementation in Most.js, and achieves similar flexibility with Rx
when providing a selector function to `.map()` on a result stream.

`fromEvent` will now emit mixed-types. If consumers are not responsible
for calling `.emit()` on the source emitter, they should implement
appropriate guards to ensure they are dealing with an intended type.



<a name="5.2.4"></a>
## [5.2.4](https://github.com/staltz/xstream/compare/v5.2.3...v5.2.4) (2016-07-20)

Expand Down
24 changes: 24 additions & 0 deletions EXTRA_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,10 @@ Creates a stream based on either:
- DOM events with the name `eventName` from a provided target node
- Events with the name `eventName` from a provided NodeJS EventEmitter

When creating a stream from EventEmitters, if the source event has more than
one argument all the arguments will be aggregated into an array in the
result stream.

Marble diagram:

```text
Expand Down Expand Up @@ -453,6 +457,26 @@ MyEmitter.emit('foo', 'bar')
> 'bar'
```

```js
import fromEvent from 'xstream/extra/fromEvent'
import {EventEmitter} from 'events'

const MyEmitter = new EventEmitter()
const stream = fromEvent(MyEmitter, 'foo')

stream.addListener({
next: i => console.log(i),
error: err => console.error(err),
complete: () => console.log('completed')
})

MyEmitter.emit('foo', 'bar', 'baz', 'buzz')
```

```text
> ['bar', 'baz', 'buzz']
```

#### Arguments:

- `element: EventTarget|EventEmitter` The element upon which to listen.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xstream",
"version": "5.2.4",
"version": "5.3.0",
"description": "An extremely intuitive, small, and fast functional reactive stream library for JavaScript",
"main": "index.js",
"typings": "index.d.ts",
Expand Down

0 comments on commit 1adc780

Please sign in to comment.