tryRead method

Future<DatumEither<DatumError, T?>> tryRead(
  1. String id, {
  2. String? userId,
  3. List<String> withRelated = const [],
})

Non-throwing variant of read. Returns Success(null) when the entity is simply absent, and Failure only on an actual error (storage, network…).

Implementation

Future<DatumEither<DatumError, T?>> tryRead(
  String id, {
  String? userId,
  List<String> withRelated = const [],
}) =>
    _guard(() => read(id, userId: userId, withRelated: withRelated));