On the logic of giving likes and canceling likes

it is similar to giving likes on moments, but users may cancel likes at will, or even click non-stop. How should the function be handled so as to find a way of thinking

Mar.12,2021

I think we can set a Boolean value for each item, which can be combined with the back end (simple can)

    [
        {id:0,isfavorite:false}
    ]

should first inquire whether this person has given likes. If not, set + 1 to like. If you have already given likes, set-1, of course, according to the corresponding cooperation in the background

.
Menu