map<U> method

Service<Id, U> map<U>(
  1. U encoder(
    1. Data
    ),
  2. Data decoder(
    1. U
    )
)

Creates a Service that wraps over this one, and maps input and output using two converter functions.

Handy utility for handling data in a type-safe manner.

Implementation

Service<Id, U> map<U>(U Function(Data) encoder, Data Function(U) decoder) {
  return _MappedService(this, encoder, decoder);
}