import * as mediaWallDirectUrlAction from '../actions/media-wall-direct-url' ; export interface State { directUrl : string ; shortenedUrl : string ; } export const initialState = { directUrl : '' , shortenedUrl : '' } ; export function reducer ( state = initialState , action ) { switch ( action . type ) { case mediaWallDirectUrlAction . ActionTypes . WALL_GENERATE_DIRECT_URL : { const directUrl = action . payload ; return Object . assign ( { } , state , { directUrl : '' } ) ; } case mediaWallDirectUrlAction . ActionTypes . WALL_SHORTEN_DIRECT_URL : { const directUrl = action . payload ; return Object . assign ( { } , state , { directUrl } ) ; } default : { return state ; } } } export const getMediaWallDirectUrl = ( state ) => state . directUrl ; export const getMediaWallShortenedtUrl = ( state ) => state . shortenedUrl ;