- Preparing search index...
- The search index is not available
sdk-v2
- codec<I, O>(config: {
decode: ((input: O) => I);
encode: ((input: I) => O);
}): Codec<I, O, Error>
-
Parameters
-
config: {
decode: ((input: O) => I);
encode: ((input: I) => O);
}
-
decode: ((input: O) => I)
-
encode: ((input: I) => O)
Returns Codec<I, O, Error>
Construct a Codec<I, O> from functions that either returns the encoded/decoded as a Right value or throws an error that will result in a Left value
Generic
I - type of input
Generic
O - type of output