update readme with mux.pair and mux.opened

This commit is contained in:
Nina Breznik 2022-12-09 18:18:15 +00:00
parent b9ff6b50b7
commit d9bda75e97
1 changed files with 9 additions and 1 deletions

View File

@ -108,13 +108,21 @@ __NOTE__: `mux.createChannel` returns `null` if the channel should not be opened
If you want multiple sessions with the same `protocol` and `id`, set `unique: false` as an option.
#### `mux.opened({ protocol: 'name of the protocol' })`
Returns boolean.
#### `mux.pair({ protocol: 'name of the protocol' }, cb)`
Calls a callback when paired.
#### `channel.open([handshake])`
Open the channel.
#### `const m = channel.addMessage(opts)`
Add a message. Options include:
Add/register a message type for a certain encoding. Options include:
``` js
{