Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.

Commit

Permalink
add example for flatmap and filter
Browse files Browse the repository at this point in the history
  • Loading branch information
北川 committed Sep 20, 2018
1 parent 60d0aa3 commit 28e1472
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,30 @@ Same as `map`, but the callback is called synchronously. Based on `es.through`

Map elements nested.

``` js
var es = require('event-stream')

es.flatmapSync(function (data) {
//transform data
// ...
return data
})

```

## filterSync (syncFunction)

Filter elements.

``` js
var es = require('event-stream')

es.filterSync(function (data) {
return data > 0
})

```

## split (matcher)

Break up a stream and reassemble it so that each line is a chunk. matcher may be a `String`, or a `RegExp`
Expand Down

0 comments on commit 28e1472

Please sign in to comment.