UNPKG

843 BMarkdownView Raw
1
2# CommentLike
3
4`CommentLike` handler class.
5
6## API
7
8### CommentLike( comment-id, site-id, WPCOM )
9
10Create a new `CommentLike` instance.
11
12```js
13var commentLike = CommentLike('<comment-id>', '<site-id>', WPCOM);
14```
15
16### CommentLike#state(fn)
17
18`CommentLike#mine` alias.
19
20### CommentLike#mine(fn)
21
22Get your like status for a comment
23
24```js
25wpcom
26.site('blog.wordpress.com')
27.comment(342)
28.like()
29.mine(function(err, data) {
30 // use CommentLike `data` object
31});
32```
33
34### CommentLike#add(fn)
35
36Like a comment
37
38```js
39wpcom
40.site('blog.wordpress.com')
41.comment(342)
42.like()
43.add(function(err, data) {
44 // I like this 342 comment
45});
46```
47
48### CommentLike#del(fn)
49
50Remove your existing like from a comment
51
52```js
53wpcom
54.site('blog.wordpress.com')
55.comment(342)
56.like()
57.del(function(err, data) {
58 // I don't like this 342 comment any more
59});
60```