watchOne method

DataStateNotifier<T?> watchOne(
  1. dynamic id, {
  2. bool? remote,
  3. Map<String, dynamic>? params,
  4. Map<String, String>? headers,
  5. AlsoWatch<T>? alsoWatch,
})

Watches changes on model of type T by id in local storage.

Optionally alsoWatches selected relationships of this model.

Example: Watch Book with id=1 and its Author relationship.

bookRepository.watchOne('1', alsoWatch: (book) => [book.author]);

When called, will in turn call findAll with remote, params, headers.

Implementation

DataStateNotifier<T?> watchOne(
  dynamic id, {
  bool? remote,
  Map<String, dynamic>? params,
  Map<String, String>? headers,
  AlsoWatch<T>? alsoWatch,
}) {
  return remoteAdapter.watchOne(
    id,
    remote: remote,
    params: params,
    headers: headers,
    alsoWatch: alsoWatch,
  );
}