Skip to content

Instantly share code, notes, and snippets.

@btodts
Last active December 6, 2022 21:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btodts/7a7d4d2cf70477b8adffaa5d1d25ac5b to your computer and use it in GitHub Desktop.
Save btodts/7a7d4d2cf70477b8adffaa5d1d25ac5b to your computer and use it in GitHub Desktop.
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