/* global __IS_DEV__*/ import React from 'react' import { createStore, combineReducers } from 'redux' import { Provider } from 'react-redux' import FooApp from './foo-app' import * as reducers from '../reducers' import * as UrlActions from '../actions/url-actions' export default class App { render(data) { let store = createStore(createStore(reducers)) if (typeof window !== 'undefined') { window.addEventListener('popstate', () => { store.dispatch(UrlActions.setUrl(window.location.pathname)) }) // grab last known URL from localStorage if in iOS standalone mode const start = (navigator.standalone && localStorage.lastUrl) || window.location.pathname store.dispatch(UrlActions.setUrl(start)) } return ( {() => } ) } }