Hacker News new | past | comments | ask | show | jobs | submit login

The Firebase JavaScript library makes make this impressively straightforward to use. I built a clone using React.js and Firebase's library. Because v0 of the API requires a request for each news story, it's not possible to use Firebase's React mixin yet.

https://github.com/ssorallen/hackernews-react




Here's another React version which also does comments (and allows you to fold them - I needed to write a userscript for that before!). It's using react-router to switch between top stories, comments, individual comment and user profile pages.

http://insin.github.io/react-hn

I've just gone for it with Firebase's React mixin, binding everything as an object, since their devs in this thread don't seem concerned about rate limiting. The mixin seems to throw an error every time I try to unbind, which I'm just catching and logging for now.

Edit: I just watched this comment pop up live in my version - pretty neat :)


Nicely done! Binding every HN story as an object would have been the simplest approach, that makes sense.

Is the source available somewhere?


Original source is here until I set up a proper repo (after modularising and setting up a build process):

https://github.com/insin/insin.github.com/blob/master/react-...


[Firebase Dev Advocate] This is great, thank you for sharing!




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: