Giter VIP home page Giter VIP logo

react-sample-app's Introduction

Sample React Application

View latest React comments on Reddit (with React/Redux)

Run

View via Github Pages at https://samvincent.github.io/react-sample-app/

NOTE: Github Pages does not allow us to enable CORS for Reddit, so Safari will not retrieve the comments. Chrome seems to be happy to allow the requests.

Build with npm run build

Goal

Implement the comment section of Reddit threads via its official API.

Features

Rational

Data

Use fetch to asynchronously retrieve data which is then passed to the reducer for addition to the applications state.

Sorting functionality is processed recursively through comment depth at the container level using the stores global sort key and the thread's comment list to avoid unnecessarily updating the state tree.

Styling

Use Radium inline styling for components so styles are declared and scoped with a component. Reduces cluttering of the css folder and makes it trivial to delete a component and have the no longer necessary styles removed at the same time.

Use CSS modules where scss provides a development speed improvement.

React logo was just a quick experiment to see how css 3D translations perform.

Potential improvements

  • Media queries implementation so UI works across mobile devices
  • Removal of development only logger middleware
  • Testing actions (potentially with redux-saga implementation)
  • Testing of components, containers, reducers
  • Network connection error message when disconnected
  • Loading message while fetching
  • Navigating through additional pages of threads and comments
  • Use ReactCSSTransitionGroup for re-ordering on sort key change
  • Allow for selection of alternate subreddits of interest

Develop

Uses react-hot-loader for immediate feedback while developing

npm install
npm start

react-sample-app's People

Contributors

samvincent avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.