1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

refactor: use let instead of var

This commit is contained in:
Tim Daubenschütz 2015-05-19 17:16:01 +02:00
parent 9784e09aac
commit 2b8e1d604b
6 changed files with 8 additions and 7 deletions

View File

@ -25,6 +25,7 @@ For this project, we're using:
* We use ES6 * 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 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 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 Reading list

View File

@ -2,8 +2,8 @@ import React from 'react';
import Router from 'react-router'; import Router from 'react-router';
var Link = Router.Link; let Link = Router.Link;
var RouteHandler = Router.RouteHandler; let RouteHandler = Router.RouteHandler;
class AscribeApp extends React.Component { class AscribeApp extends React.Component {

View File

@ -6,7 +6,7 @@ import PieceListActions from '../actions/piece_list_actions';
let Link = Router.Link; let Link = Router.Link;
var PieceList = React.createClass({ let PieceList = React.createClass({
getInitialState() { getInitialState() {
return PieceListStore.getState(); return PieceListStore.getState();
}, },

View File

@ -1,4 +1,4 @@
var constants = { let constants = {
'baseUrl': 'http://staging.ascribe.io/api/', 'baseUrl': 'http://staging.ascribe.io/api/',
'debugCredentialBase64': 'ZGltaUBtYWlsaW5hdG9yLmNvbTowMDAwMDAwMDAw' // dimi@mailinator:0000000000 'debugCredentialBase64': 'ZGltaUBtYWlsaW5hdG9yLmNvbTowMDAwMDAwMDAw' // dimi@mailinator:0000000000
}; };

View File

@ -3,7 +3,7 @@ import fetch from 'isomorphic-fetch';
import AppConstants from '../constants/application_constants'; import AppConstants from '../constants/application_constants';
import FetchApiUtils from '../utils/fetch_api_utils'; import FetchApiUtils from '../utils/fetch_api_utils';
var PieceListFetcher = { let PieceListFetcher = {
/** /**
* Fetches a list of pieces from the API. * Fetches a list of pieces from the API.
* Can be called with all supplied queryparams the API. * Can be called with all supplied queryparams the API.

View File

@ -5,9 +5,9 @@ import AscribeApp from './components/ascribe_app';
import PieceList from './components/piece_list'; import PieceList from './components/piece_list';
import Piece from './components/piece'; import Piece from './components/piece';
var Route = Router.Route; let Route = Router.Route;
var routes = ( let routes = (
<Route name="app" path="/" handler={AscribeApp}> <Route name="app" path="/" handler={AscribeApp}>
<Route name="pieces" handler={PieceList} /> <Route name="pieces" handler={PieceList} />
<Route name="piece" path="/artworks/:bitcoin_ID_noPrefix" handler={Piece} /> <Route name="piece" path="/artworks/:bitcoin_ID_noPrefix" handler={Piece} />