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
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
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
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 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
// General imports | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import SliderMonitor from 'redux-slider-monitor'; | |
import DevTools from '../lib/tools/devtools'; | |
if(process.env.feature.DEV) { | |
const store = window.__STORE__; | |
ReactDOM.render(<DevTools store={store}/>, document.getElementById('devtools')); | |
} |
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 React, {Component} from 'react'; | |
import {Link} from 'react-router'; | |
import feed from '../../../../lib/modules/feed'; | |
import {connect} from 'react-redux'; | |
if(process.env.BROWSER) { | |
require('../../../../styles/components/feed.scss'); | |
} | |
class Feed extends Component { |
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 React from 'react'; | |
import { createDevTools } from 'redux-devtools'; | |
import LogMonitor from 'redux-devtools-log-monitor'; | |
import DockMonitor from 'redux-devtools-dock-monitor'; | |
import SliderMonitor from 'redux-slider-monitor'; | |
const DevTools = createDevTools( | |
<DockMonitor toggleVisibilityKey='ctrl-h' | |
changePositionKey='ctrl-q' |
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 07/12/15. | |
*/ | |
// Imports | |
import env from './utils/environment'; | |
import express from 'express'; | |
import {webpack as webPackCustomMiddleware, render} from './middleware'; | |
import compression from 'compression'; |
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 webpackMw from './webpack'; | |
import { match } from 'react-router'; | |
import createLocation from 'history/lib/createLocation'; | |
import env from '../utils/environment'; | |
import {renderEngine, renderIndex as renderStatic} from '../engines'; | |
import routes from '../../app/scripts/routes'; | |
import {initialise} from '../../app/lib'; |