I have two components: CreateComment and DisplayComment. DisplayComment component has itself nested in it for displaying the threaded comments.
Now, whenever I create a comment from CreateComment component, I call a subject in CommentService to emit an event. This subject is being subscribed in the DisplayComment component in which I am pushing the comment to the comments array to be rendered.
Since I have nested components, this subscription is being called multiple times (according to the threaded comments count).
Can someone please let me know if there is any way I can restrict the subscription execution on the DisplayComment method to only one time?