2015-06-29 16:50:25 +00:00
|
|
|
import Rx from 'rx';
|
2015-07-04 18:48:55 +00:00
|
|
|
import assign from 'object.assign';
|
2015-07-04 00:40:12 +00:00
|
|
|
import { Router } from 'react-router';
|
|
|
|
import App from './App.jsx';
|
2015-07-13 07:25:01 +00:00
|
|
|
import AppCat from './Cat';
|
2015-06-29 16:50:25 +00:00
|
|
|
|
2015-07-04 00:40:12 +00:00
|
|
|
import childRoutes from './routes';
|
2015-06-29 16:50:25 +00:00
|
|
|
|
|
|
|
const router$ = Rx.Observable.fromNodeCallback(Router.run, Router);
|
|
|
|
|
2015-07-04 18:48:55 +00:00
|
|
|
const routes = assign({ components: App }, childRoutes);
|
2015-06-29 16:50:25 +00:00
|
|
|
|
|
|
|
export default function app$(location) {
|
2015-07-13 07:25:01 +00:00
|
|
|
return router$(routes, location)
|
|
|
|
.map(([initialState, transistion]) => {
|
|
|
|
return { initialState, transistion, AppCat };
|
|
|
|
});
|
2015-06-29 16:50:25 +00:00
|
|
|
}
|