freeCodeCamp/common/app/app-stream.jsx

18 lines
469 B
JavaScript
Raw Normal View History

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';
import App from './App.jsx';
import AppCat from './Cat';
2015-06-29 16:50:25 +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-06-29 16:50:25 +00:00
}