const defaultRandNumericalThemeName = ( ) : string => `${ Math . floor ( Math . random ( ) * 90000 ) + 10000 }` ; export const themeNameReducer = ( state = defaultRandNumericalThemeName ( ) , action ) => { switch ( action . type ) { case 'SET_THEME_NAME' : return action . payload ; case 'RESET' : return defaultRandNumericalThemeName ( ) ; default : return state ; } } ;