Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
fix(app): remove routes from configure_* funcs
Browse files Browse the repository at this point in the history
fix(app): remove routes from configure_* funcs
  • Loading branch information
Metnew committed Feb 18, 2018
1 parent 1b4dfe3 commit 8bf5a0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
9 changes: 4 additions & 5 deletions src/common/app/configure_app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
import thunk from 'redux-thunk'
import {createStore, applyMiddleware, compose} from 'redux'
import {routerMiddleware} from 'react-router-redux'
// // Application
import promiseMiddleware from 'redux-promise-middleware'
// Application
import rootReducer from 'reducers'
import {history, getRoutes} from 'routing'
import {history} from 'routing'
//
/**
* Configure application store
* @param {Object} initialState - preloadedState
* @return {Object} - configured store
*/
const configureStore = (initialState: Object) => {
const middlewares = [thunk, routerMiddleware(history)]
const middlewares = [thunk, routerMiddleware(history), promiseMiddleware()]
const enhancers = middlewares.map(a => applyMiddleware(a))

const getComposeFunc = () => {
Expand All @@ -36,11 +37,9 @@ const configureStore = (initialState: Object) => {
* @return {Object} Object containting configured store, routes, history
*/
export default (initialState: Object) => {
const routes = getRoutes()
const store = configureStore(initialState)
return {
store,
routes,
history
}
}
9 changes: 3 additions & 6 deletions src/common/app/configure_root/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
* @desc
*/
import React from 'react'
import type {RouteItem} from 'types'
// Redux stuff
import Root from 'components/parts/Root'
// Styled-components's injectGlobal styles
import Root from 'components/Root'
// global styles
import 'styles/global'

type Props = {
i18n: Object,
store: Object, // unconfigured store
SSR: {
SSR?: {
// SSR options, see `/server` for more info
context: Object,
location: string
},
history: Object, // Root node with routing, synced history, store
routes: RouteItem[] // app routing
}

/**
Expand Down

0 comments on commit 8bf5a0f

Please sign in to comment.