mapTransport
function mapTransport<A, B>( inner, encode,decode): Transport<B>;Defined in: transport.ts:23
Adapt a Transport<A> into a Transport<B> through a codec. Use it to wrap,
namespace, version, compress, or otherwise reshape messages without rewriting
the underlying wire — e.g. multiplex several features over one socket by
tagging messages, or persist a different shape than you transmit.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
A |
B |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
inner | Transport<A> |
encode | (message) => A |
decode | (message) => B |
Returns
Section titled “Returns”Transport<B>