getComments method

ValueStream<Comments?> getComments(
  1. Authorperm postId
)

Implementation

ValueStream<Comments?> getComments(Authorperm postId) {
  final BehaviorSubject<Comments?> controller;
  if (_commentsStreamControllers.containsKey(postId)) {
    controller = _commentsStreamControllers[postId]!;
  } else {
    controller = BehaviorSubject<Comments?>();
    _commentsStreamControllers[postId] = controller;

    unawaited(_fetchAndAddComments(postId));
  }

  return controller;
}