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