3 ms·
The visualisation of live upvotes is nice, how did you handle that state-wise in React? I also have comment counts and whatever data is used to dim downvoted c
by insin 12y ago
The visualisation of live upvotes is nice, how did you handle that state-wise in React?
I also have comment counts and whatever data is used to dim downvoted comments on my API wishlist ( my own implementation is http://insin.github.io/react-hn http://insin.github.io/react-hn ).
An endpoint for just ask/show/jobs items would also be nice.
- antouank 12y ago@insin This project is an opportunity for me to make some production-ready thing on Flux/React. I'm new to it. I have two stores, one for the news stories, and one for the comments. And then a smaller one for the notifications. I don't use any state in the components. Everything propagates from the top level and the stores. The counter component doesn't have a state, but when it sees an update, it just adds/removes a class and that's how you get the animation.