diff --git a/src/app/redux/modules/stars/stars.ts b/src/app/redux/modules/stars/stars.ts index 39e123a..216aea8 100644 --- a/src/app/redux/modules/stars/stars.ts +++ b/src/app/redux/modules/stars/stars.ts @@ -1,4 +1,3 @@ -import fetch from 'isomorphic-fetch'; import { IStars, IStarsAction } from './stars.model'; /** Action Types */ @@ -37,7 +36,7 @@ export function starsReducer(state = initialState, action: IStarsAction) { return state; } -}; +} /** Async Action Creator */ export function getStars(): Redux.Dispatch { diff --git a/src/client.tsx b/src/client.tsx index d26db4e..7ec66d6 100644 --- a/src/client.tsx +++ b/src/client.tsx @@ -1,3 +1,7 @@ +import * as e6p from 'es6-promise'; +(e6p as any).polyfill(); +import 'isomorphic-fetch'; + import * as React from 'react'; import * as ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; @@ -10,8 +14,8 @@ const store: Redux.Store = configureStore(window.__INITIAL_STATE__); const history = syncHistoryWithStore(browserHistory, store); ReactDOM.render( - - - , - document.getElementById('app') + + + , + document.getElementById('app') ); diff --git a/src/server.tsx b/src/server.tsx index 0e3b4dd..37f6a91 100644 --- a/src/server.tsx +++ b/src/server.tsx @@ -1,17 +1,18 @@ const appConfig = require('../config/main'); -import * as e6p from "es6-promise"; +import * as e6p from 'es6-promise'; (e6p as any).polyfill(); +import 'isomorphic-fetch'; import * as React from 'react'; import * as ReactDOMServer from 'react-dom/server'; -import * as ReactRouter from "react-router"; +import * as ReactRouter from 'react-router'; const RouterContext = ReactRouter.RouterContext as any; import { Provider } from 'react-redux'; import { syncHistoryWithStore } from 'react-router-redux'; import { configureStore } from './app/redux/store'; -import routes from "./app/routes"; +import routes from './app/routes'; import { Html } from './app/containers'; const manifest = require('../build/manifest.json'); @@ -19,7 +20,7 @@ const manifest = require('../build/manifest.json'); const Express = require('express'); const path = require('path'); const compression = require('compression'); -const Chalk = require("chalk"); +const Chalk = require('chalk'); const favicon = require('serve-favicon'); const store = configureStore(); @@ -28,12 +29,12 @@ const app = Express(); app.use(compression()); app.use(favicon(path.join(__dirname, '..', 'favicon.ico'))); -if (process.env.NODE_ENV == "development") { +if (process.env.NODE_ENV == 'development') { const webpack = require('webpack'); const webpackConfig = require('../config/webpack/dev'); const webpackCompiler = webpack(webpackConfig); - app.use(require("webpack-dev-middleware")(webpackCompiler, { + app.use(require('webpack-dev-middleware')(webpackCompiler, { publicPath: webpackConfig.output.publicPath, stats: { colors: true }, quiet: true, @@ -44,10 +45,10 @@ if (process.env.NODE_ENV == "development") { historyApiFallback: true })); - app.use(require("webpack-hot-middleware")(webpackCompiler)); + app.use(require('webpack-hot-middleware')(webpackCompiler)); } -app.use(favicon(path.resolve("favicon.ico"))); +app.use(favicon(path.resolve('favicon.ico'))); app.use('/public', Express['static'](path.join(__dirname, '../build/public')));