Skip to content

Comments 0.2.9: Tell people when their comment is liked

Comments 0.2.9 lets a module or app react when someone likes or dislikes a comment, for example to send “X liked your comment” notifications.

A resource handler could already be told when a comment was created or deleted. It can now also implement on_comment_liked/3, on_comment_unliked/3, on_comment_disliked/3 and on_comment_undisliked/3. Each gets the comment and the uuid of the person who reacted. They fire only when the reaction really changed, never on a repeated click or an error. Each is optional, and existing handlers keep working.

A reaction still costs one extra lookup, shared by the live update and the callback, and a failing callback cannot undo a reaction that was saved. The module no longer declares leaf itself; it comes from PhoenixKit core.

 

 


Comments 0.2.9. Install or update: {:phoenix_kit_comments, "~> 0.2"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.