diff --git a/client/index.js b/client/index.js index 0de40272a41..e775b6ceca3 100644 --- a/client/index.js +++ b/client/index.js @@ -1,23 +1,31 @@ -import BrowserHistory from 'react-router/lib/BrowserHistory'; +import Rx from 'rx'; +import React from 'react'; +import { Router } from 'react-router'; +import { history } from 'react-router/lib/BrowserHistory'; import debugFactory from 'debug'; import { Cat } from 'thundercats'; import { app$ } from '../common/app'; const debug = debugFactory('fcc:client'); -const DOMContianer = document.getElemenetById('#fCC'); +const DOMContianer = document.getElementById('fcc'); const fcc = new Cat(); +Rx.longStackSupport = !!debug.enabled; + // returns an observable -app$(BrowserHistory) - .flatMap(app => { - return fcc.render(app, DOMContianer); +app$(history) + .flatMap(([ initialState ]) => { + return fcc.render(React.createElement(Router, initialState), DOMContianer); }) .subscribe( - function() { + () => { debug('react rendered'); }, - function(err) { + err => { debug('an error has occured', err.stack); + }, + () => { + debug('react closed subscription'); } );