I am using firebase database and cloud functions to implement an upvote downvote system.

For the sake of responsiveness vote action also executes on the client side by a react setstate. 

```
vote(id, voteValue){
    let totalVoteObj = this.props.totalVote
    //modify totalVoteObj to change a specific vote value
    //....
    this.setState({
        totalVoteObj: totalVoteObj
    })
}

```

Then when a cloud function increments the total vote count firebase listener will send newProps

```
componentWillReceiveProps(nextProps){
    this.setState({
        totalVoteObj: nextProps.totalVote
    })
}

```

However the issue with this approach is that if a user makes 2 votes real fast before the server's first response vote button will blink.

```
Expected                      What user sees on screen
initial                                 0
upvote                                  1
downvote                                0

What happens: 
initial vote state                      0
user upvotes                            1
user downvotes                          0
server responds to first user action    1
server responds to second user action   0

```

I've considered and tried few different approaches but I wasn't completely satisfied with any of the outcomes. 

* Comparing votes on componentWillReceiveProps which got tricky and caused issues when multiple users vote on the same item.
* Locking user out until the response ends up making the app look less responsive.
* Tried a cloud functions solution which caused considerable lag.
* setTimeout and evaluate the vote outcome after a certain time and send a single response (which would also make sense because user shouldn't be able to make that many requests anyways because it would increase our server and database costs)

Everything works out okay unless the user spams the vote button (even if the user spams final vote value will be correct) but the clientside just appears clunky or unstable. So I just wondered if there is a "textbook" solution to deal with this using React/Redux/Firebase.

Edit: Users have unique votes, the issue happens when user keeps changing his vote within few seconds. As in spamming the buttons upvote, downvote, upvote, downvote...