Last active
December 6, 2022 21:52
-
-
Save btodts/7a7d4d2cf70477b8adffaa5d1d25ac5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as actions from "./actions"; | |
import { combineReducers } from "redux"; | |
const preferences = (state = { darkThemeEnabled: false }, action) => { | |
switch (action.type) { | |
case actions.TOGGLE_DARKTHEME: | |
return { ...state, darkThemeEnabled: !state.darkThemeEnabled }; | |
default: | |
return state; | |
} | |
}; | |
export default combineReducers({ preferences }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment