exists method

Future<bool> exists(
  1. String id, {
  2. String? userId,
})

Returns whether an entity with id exists in local storage.

A convenience for await read(id) != null that skips relation loading and post-fetch transforms.

Implementation

Future<bool> exists(String id, {String? userId}) async {
  _ensureInitialized();
  return (await localAdapter.read(id, userId: userId)) != null;
}