diff --git a/README.md b/README.md index 7cc52667..64429ffb 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ For this project, we're using: * We use ES6 * We don't use ES6's class declaration for React components because it does not support Mixins as well as Autobinding ([Blog post about it](http://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html#autobinding)) * We don't use camel case for file naming but in everything Javascript related +* We use `let` instead of `var`: [SA Post](http://stackoverflow.com/questions/762011/javascript-let-keyword-vs-var-keyword) Reading list diff --git a/js/components/ascribe_app.js b/js/components/ascribe_app.js index f5ff7c93..ead715f9 100644 --- a/js/components/ascribe_app.js +++ b/js/components/ascribe_app.js @@ -2,8 +2,8 @@ import React from 'react'; import Router from 'react-router'; -var Link = Router.Link; -var RouteHandler = Router.RouteHandler; +let Link = Router.Link; +let RouteHandler = Router.RouteHandler; class AscribeApp extends React.Component { diff --git a/js/components/piece_list.js b/js/components/piece_list.js index 516ad62e..6c85efb3 100644 --- a/js/components/piece_list.js +++ b/js/components/piece_list.js @@ -6,7 +6,7 @@ import PieceListActions from '../actions/piece_list_actions'; let Link = Router.Link; -var PieceList = React.createClass({ +let PieceList = React.createClass({ getInitialState() { return PieceListStore.getState(); }, diff --git a/js/constants/application_constants.js b/js/constants/application_constants.js index 982a5373..8efb7196 100644 --- a/js/constants/application_constants.js +++ b/js/constants/application_constants.js @@ -1,4 +1,4 @@ -var constants = { +let constants = { 'baseUrl': 'http://staging.ascribe.io/api/', 'debugCredentialBase64': 'ZGltaUBtYWlsaW5hdG9yLmNvbTowMDAwMDAwMDAw' // dimi@mailinator:0000000000 }; diff --git a/js/fetchers/piece_list_fetcher.js b/js/fetchers/piece_list_fetcher.js index 133070fd..4e4b7567 100644 --- a/js/fetchers/piece_list_fetcher.js +++ b/js/fetchers/piece_list_fetcher.js @@ -3,7 +3,7 @@ import fetch from 'isomorphic-fetch'; import AppConstants from '../constants/application_constants'; import FetchApiUtils from '../utils/fetch_api_utils'; -var PieceListFetcher = { +let PieceListFetcher = { /** * Fetches a list of pieces from the API. * Can be called with all supplied queryparams the API. diff --git a/js/routes.js b/js/routes.js index 2aa89bc2..b093f79c 100644 --- a/js/routes.js +++ b/js/routes.js @@ -5,9 +5,9 @@ import AscribeApp from './components/ascribe_app'; import PieceList from './components/piece_list'; import Piece from './components/piece'; -var Route = Router.Route; +let Route = Router.Route; -var routes = ( +let routes = (