This file contains hidden or 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 default Styles | |
import '../styles/general/styles.scss'; | |
// Import Modules | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import createBrowserHistory from 'history/lib/createBrowserHistory' | |
import Router from 'react-router'; | |
import routes from './routes'; | |
import {initialise} from '../lib'; |
This file contains hidden or 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 ModuleCollector { | |
constructor(config) { | |
this.actions = []; | |
this.reducers = []; | |
this.modules = {}; | |
this.config = config; | |
} | |
add(newModule) { | |
if (typeof newModule === 'function') { |
This file contains hidden or 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 { combineReducers, createStore, compose, applyMiddleware } from 'redux'; | |
import DevTools from '../tools/devtools'; | |
function _buildStore(middlewares, reducers) { | |
let functions = [applyMiddleware(...middlewares)]; | |
if (process.env.feature.DEV) { | |
functions.push(require('../tools/devtools').default.instrument()); | |
} | |
return compose( | |
...functions |
This file contains hidden or 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 ModuleCollector from './modules/moduleCollector'; | |
import storeBuilder from './store/storeBuilder'; | |
import feed from './modules/feed'; | |
export function initialise(customMiddlewares = []) { | |
const moduleCollector = new ModuleCollector(); | |
moduleCollector.add(feed); | |
const coreReducers = moduleCollector.getReducers(); |
This file contains hidden or 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 feeds(state = [], action) { | |
if (action.type === 'get') return action.payload; | |
else return state; | |
} | |
export default { | |
feeds | |
} |
This file contains hidden or 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 default function (config) { | |
return { | |
loadFeeds() { | |
return { type: 'get', payload: ['feed 1', 'feed 2', 'feed 3'] } | |
} | |
} | |
} |
This file contains hidden or 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 actions from './actions'; | |
import reducers from './reducers'; | |
export default (config) => { | |
return { | |
actions: actions(config), | |
reducers, | |
name: 'feed' | |
}; | |
}; |
This file contains hidden or 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
. | |
├── app | |
│ ├── images | |
│ ├── index.html | |
│ ├── lib | |
│ │ ├── index.js | |
│ │ ├── middleware | |
│ │ ├── modules | |
│ │ │ ├── feed | |
│ │ │ │ ├── actions.js |
This file contains hidden or 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 {RoutingContext} from 'react-router'; | |
import ejs from 'ejs'; | |
import React from 'react'; | |
import ReactDOMServer from 'react-dom/server'; | |
const _renderComponents = (props) => { | |
return ReactDOMServer.renderToString( | |
<RoutingContext {...props} /> | |
); | |
}; |
This file contains hidden or 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
/** | |
* Created by mobinni on 08/12/15. | |
*/ | |
import webpack from './webpack'; | |
import { match } from 'react-router'; | |
import createLocation from 'history/lib/createLocation'; | |
import {env} from '../utils'; | |
import {renderEngine} from '../engines'; | |
import routes from '../../app/scripts/routes'; |