2015-06-29 16:50:25 +00:00
|
|
|
import Rx from 'rx';
|
2015-09-14 01:12:22 +00:00
|
|
|
import { match } from 'react-router';
|
2015-07-04 00:40:12 +00:00
|
|
|
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
|
|
|
|
2015-09-14 01:12:22 +00:00
|
|
|
const route$ = Rx.Observable.fromNodeCallback(match);
|
2015-06-29 16:50:25 +00:00
|
|
|
|
2015-09-09 02:32:45 +00:00
|
|
|
const routes = Object.assign({ components: App }, childRoutes);
|
2015-06-29 16:50:25 +00:00
|
|
|
|
2015-09-14 01:12:22 +00:00
|
|
|
export default function app$({ location, history }) {
|
|
|
|
return route$({ routes, location, history })
|
|
|
|
.map(([nextLocation, props]) => {
|
|
|
|
return { nextLocation, props, AppCat };
|
2015-07-13 07:25:01 +00:00
|
|
|
});
|
2015-06-29 16:50:25 +00:00
|
|
|
}
|