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 { addStateListeners } from './storeObserver' | |
import { addPostDispatchListeners } from './listenerMiddleware' | |
let startTime = null | |
let dataLoaded = true | |
let pageRendered = false | |
const start = (time) => { | |
startTime = time | |
dataLoaded = true |
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, { Component } from 'react'; | |
import ReactDOM from 'react-dom'; | |
let instance = null; | |
export const getTop = () => { | |
return instance.getTop(); | |
} | |
export default class InjectPoint { |
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, {Component} from 'react' | |
import {connect} from 'react-redux' | |
import classNames from 'classnames' | |
class InjectPoint extends Component { | |
render () { | |
const {popUpStack} = this.props | |
const children = popUpStack.map((item, i) => { | |
const clonedChild = React.cloneElement(item.Component, { | |
...item.Component.props, |
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
// Super simple data layer for fetching raw product data from the server | |
export const defaultOptions = { | |
headers: { | |
'Content-Type': 'application/json' | |
} | |
}; | |
const mergeOptions = (...options) => { | |
return Object.assign({}, defaultOptions, ...options); | |
}; |
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
// A simple isomorphic-fetch mock that returns what you pass into it so we can assert that the methods in products.js | |
// are passing the correct values (I'd add rejection logic in here too to test those cases but this is just for demo purposes) | |
const fetch = (url, options) => { | |
return Promise.resolve({url, options}); | |
}; | |
export default fetch; |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |