Feat: Welcome Page (#17150)

This commit is contained in:
Stuart Taylor
2018-05-15 06:12:05 +01:00
committed by mrugesh mohapatra
parent 47bb4ca5e3
commit 156ea1af76
172 changed files with 693 additions and 9738 deletions

View File

@@ -3,38 +3,34 @@ import debug from 'debug';
import {
types as appTypes,
createErrorObservable,
currentChallengeSelector
createErrorObservable
} from '../../redux';
import { types, fetchMapUiComplete } from './';
import { langSelector } from '../../Router/redux';
import { shapeChallenges } from '../../redux/utils';
const isDev = debug.enabled('fcc:*');
export default function fetchMapUiEpic(
actions,
{ getState },
_,
{ services }
) {
return actions::ofType(
return actions.do(console.log)::ofType(
appTypes.appMounted,
types.fetchMapUi.start
)
.flatMapLatest(() => {
const lang = langSelector(getState());
const options = {
params: { lang },
service: 'map-ui'
};
return services.readService$(options)
.retry(3)
.do(console.info)
.map(({ entities, ...res }) => ({
entities: shapeChallenges(
entities,
isDev
),
initialNode: currentChallengeSelector(getState()),
...res
}))
.map(fetchMapUiComplete)