registerJsonDecoder<T> method

void registerJsonDecoder<T>(
  1. T f(
    1. String
    )
)

add json decoder for type

Implementation

void registerJsonDecoder<T>(T Function(String) f) {
  if (T == dynamic) {
    NatsException('can not register dyname type');
  }
  _jsonDecoder[T] = f;
}