This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const isFunction = input => typeof input === 'function'; | |
export default predicate => elemOrThunk => | |
predicate ? (isFunction(elemOrThunk) ? elemOrThunk() : elemOrThunk) : null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DumbComponent = (props) => { | |
return (<div />); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var object1 = {color: "blue", size: 12}; | |
var object2 = object1 | |
object2.color = "red" | |
object1 === object2 //true | |
object3 = Object.assign({}, object1) | |
object3.color = "red" | |
object1 === object3 //false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const isObjectEqual = (obj1, obj2) => { | |
if(!isObject(obj1) || !isObject(obj2)) { | |
return false; | |
} | |
if (obj1 === obj2) { | |
return true; | |
} | |
const item1Keys = Object.keys(obj1).sort(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var debug = process.env.NODE_ENV !== "production"; | |
var webpack = require('webpack'); | |
var path = require("path"); | |
require("babel-polyfill"); | |
module.exports = { | |
context: path.join(__dirname, "src"), | |
devtool: debug ? "inline-sourcemap" : null, | |
entry: ["babel-polyfill", "./" + path.join("js", "scripts.js")], | |
module: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Perf from 'react-addons-perf' | |
window.Perf = Perf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import {parseUri} from "../../../utils"; | |
const AutocompleteItem = (props) => { | |
const {props} = this; | |
const selectedClass = props.selected === true ? "selected" : ""; | |
var path = parseUri(props.url).path; | |
path = path.length <= 0 ? props.url : "..." + path; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import {parseUri} from "../../../utils"; | |
export default class AutocompleteItem extends React.Component { | |
shouldComponentUpdate(nextProps, nextState) { | |
if( | |
nextProps.url !== this.props.url || | |
nextProps.selected !== this.props.selected | |
){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
export default class Tooltip extends React.Component { | |
state = { | |
visible: false, | |
imageStatus: null | |
} | |
handleImageLoaded = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {createReducer} from '../utils'; | |
import {LOGIN_USER_REQUEST, LOGIN_USER_SUCCESS, LOGIN_USER_FAILURE, LOGOUT_USER} from '../constants'; | |
import {pushState} from 'redux-router'; | |
import jwtDecode from 'jwt-decode'; | |
const initialState = { | |
token: null, | |
userName: null, | |
isAuthenticated: false, | |
isAuthenticating: false, |