json<T> static method

ApiCacheCodec<T> json<T>()

For answers that are already JSON-shaped.

Implementation

static ApiCacheCodec<T> json<T>() => ApiCacheCodec<T>(
      encode: (value) => jsonEncode(value),
      decode: (data) => jsonDecode(data) as T,
    );