Skip to content
Repos

DevPlaceApp

C++ 570 B17 lines Opens in site

Directory Raw Download

#pragma once
// Spec: Model Updates (Array<Comment>.updatingVote / updatingReaction). Pure functions over comment forests.
#include <string>
#include <vector>

#include "model/Comment.hpp"

namespace dp {

class CommentTree {
 public:
  static std::vector<Comment> updatingVote(const std::vector<Comment>& comments, const std::string& commentId, Vote vote);
  static std::vector<Comment> updatingReaction(const std::vector<Comment>& comments, const std::string& commentId,
                                               const std::string& emoji);
};

}  // namespace dp
45.7ms