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
Alan Shaw authored May 9, 2019
1 parent 53e3a15 commit d8cb660
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 @@ -118,6 +118,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 d8cb660

Please sign in to comment.