import { ActionType , getType } from 'typesafe-actions' ; import * as walkthroughActions from '../actions/walkthroughActions' ; import { Walkthrough , WalkthroughRecord } from '../store/factory/Walkthrough' ; export function walkthroughReducer ( state , action ) { if ( typeof state === 'undefined' ) { return Walkthrough ( ) ; } if ( action . type === getType ( walkthroughActions . setActiveStep ) ) { return state . set ( 'activeStep' , action . payload ) ; } if ( action . type === getType ( walkthroughActions . setActiveWalkthrough ) ) { return state . set ( 'activeWalkthrough' , action . payload ) ; } return state ; }