Reorganize redux types to avoid unnecessary type casting

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2021-07-21 22:52:49 +02:00
parent a221ce4255
commit 6a43d0c5fb
27 changed files with 113 additions and 153 deletions

View file

@ -8,11 +8,10 @@ import { store } from '..'
import { DarkModeConfig, DarkModeConfigActionType, SetDarkModeConfigAction } from './types'
export const setDarkMode = (darkMode: boolean): void => {
const action: SetDarkModeConfigAction = {
store.dispatch({
type: DarkModeConfigActionType.SET_DARK_MODE,
darkMode: darkMode
}
store.dispatch(action)
} as SetDarkModeConfigAction)
}
export const saveToLocalStorage = (darkModeConfig: DarkModeConfig): void => {