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 function connect(...stores) { | |
let filter = s => s; | |
if (!stores[stores.length - 1].__reduxName) | |
filter = stores.pop(); | |
let connector = reduxConnect( | |
filter.length > 1 | |
? (state, props) => filter(storesState(state, stores), props) | |
: (state) => filter(storesState(state, stores)) |
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 function run(config, assert) { | |
return new Promise((resolve, reject) => { | |
let compiler = webpack(config) | |
let fs = compiler.outputFileSystem = new MemoryFileSystem(); | |
compiler.run(function (err, stats) { | |
if (err) return reject(err) | |
let errors = stats.compilation.errors || []; | |
if (assert) expect(errors.length).to.equal(0, errors.join('\n')) |
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
class Tab { | |
static childContextTypes = { | |
registerHook: PropTypes.func | |
} | |
constructor() { | |
super() | |
this._hooks = [] | |
} | |
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 ListMovementMixin from 'react-widgets/lib/mixins/ListMovementMixin'; | |
import List from 'react-widgets/lib/List'; | |
import ListOption from 'react-widgets/lib/ListOption'; | |
import { dataText } from 'react-widgets/lib/util/dataHelpers'; | |
import cn from 'classnames'; | |
import BaseVirtualList from 'react-list'; | |
let VirtualList = React.createClass({ |
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 { Router as BaseRouter } from 'react-router'; | |
import { getParamNames, formatPattern } from 'react-router/lib/PatternUtils'; | |
import { createRoutes } from 'react-router/lib/RouteUtils' | |
import createBrowserHistory from 'history/lib/createBrowserHistory'; | |
import useBeforeUnload from 'history/lib/useBeforeUnload'; | |
import invariant from 'app/utils/invariant'; | |
import { each, pick, omit, sortBy } from 'lodash'; | |
const EMPTY_AREA = '@@none'; |
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 { render, findDOMNode } from 'react-dom' | |
render(<div/>, document.getElementById('root')) |
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 { createStore } from 'redux'; | |
import combineReducers from './combineReducers'; | |
let Store = createStore(combineReducers({ | |
reducerA(state = 0, action, waitFor){ | |
if ( action.type === 'TEST'){ | |
waitState = waitFor(waitFor.reducerB) | |
if ( waitState.reducerB === 5 ) | |
state = 10 |
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
function fetchSiteStatus(){ | |
//pretend this is being fetched from a server | |
return { | |
type: 'FETCH_SITE_STATUS' | |
payload: { currentStatus: 'awesome', currentUser: 'John', lastLogin: new Date() } | |
} | |
} | |
function fetchStatuses(){ |
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
/*global CodeMirror */ | |
function indexOf(string, pattern, from) { | |
if (typeof pattern === "string") { | |
var found = string.indexOf(pattern, from); | |
return found; | |
} | |
var m = pattern.exec(from ? string.slice(from) : string); | |
return m ? (m.index + from) : -1; | |
} |
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
.cm-s-monokai .cm-tag.cm-error, | |
.cm-s-monokai .cm-bracket.cm-error { | |
color: #f92672; | |
background: transparent; | |
} |