interface CrossChannel.Constructors
Defines the static CrossChannel API.
Methods
combine
Returns a CrossChannel where the send module comprises the given writeCh, and the receive module conists of the given readCh.
combinewriteCh, and the receive module conists of the given readCh.Definition
combine<TSend = void, TReceive = TSend>(writeCh: Channel.Write<TSend>, readCh: Channel.Read<TReceive>): CrossChannel<TSend, TReceive>;
Type parameters
| Name | Default | Description |
|---|---|---|
| TSend | void | the send message type |
| TReceive | TSend | the receive message type |
Parameters
| Name | Type | Description |
|---|---|---|
writeCh | Channel.Write<TSend> | the write channel to use for sending messages |
readCh | Channel.Read<TReceive> | the read channel to use for receiving messages |
createPair
Returns a pair of connected CrossChannels of which the send module of the first is connected to the receive module of the second, and the send module of the second is connected to the receive module of the first.
createPairDefinition
createPair<TSend = void, TReceive = TSend>(config?: CrossChannel.Config): CrossChannel.Pair<TSend, TReceive>;
Type parameters
| Name | Default | Description |
|---|---|---|
| TSend | void | the send message type |
| TReceive | TSend | the receive message type |
Parameters
| Name | Type | Description |
|---|---|---|
config | CrossChannel.Config |