Skip to content
This repository has been archived by the owner on Mar 11, 2020. It is now read-only.

Commit

Permalink
docs: add example for onStream as prop
Browse files Browse the repository at this point in the history
  • Loading branch information
alanshaw authored and jacobheun committed Jul 25, 2019
1 parent 19dc424 commit e5897e3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ pipe(conn, muxer, conn) // conn is duplex connection to another peer

Use this property as an alternative to passing `onStream` as an option to the `Muxer` constructor.

```js
const muxer = new Muxer()
// ...later
muxer.onStream = stream => { /* ... */ }
```

#### `const stream = muxer.newStream([options])`

Initiate a new stream with the remote. Returns a [duplex stream](https://gist.github.com/alanshaw/591dc7dd54e4f99338a347ef568d6ee9#duplex-it).
Expand Down

0 comments on commit e5897e3

Please sign in to comment.