import { SET_COSMO_THEME, SetCosmoThemeAction } from './actions' import { Theme } from './interfaces' export type ThemeState = Theme | {} export const createThemeReducer = (initialTheme: Theme) => (state = initialTheme, action: SetCosmoThemeAction) => { switch (action.type) { case SET_COSMO_THEME: return updateTheme(state, action) default: return state } } const updateTheme = (state: any, action: SetCosmoThemeAction) => action.theme