mirror of
https://github.com/captbaritone/webamp.git
synced 2026-08-03 15:34:25 +00:00
Split out settings reducer
This commit is contained in:
parent
2770b8ca56
commit
b8f0ec8947
2 changed files with 17 additions and 14 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import { combineReducers } from "redux";
|
||||
import { SET_AVAILABLE_SKINS } from "../actionTypes";
|
||||
|
||||
import playlist from "./playlist";
|
||||
import windows from "./windows";
|
||||
|
|
@ -8,19 +7,7 @@ import display from "./display";
|
|||
import userInput from "./userInput";
|
||||
import equalizer from "./equalizer";
|
||||
import network from "./network";
|
||||
|
||||
const defaultSettingsState = {
|
||||
availableSkins: []
|
||||
};
|
||||
|
||||
const settings = (state = defaultSettingsState, action) => {
|
||||
switch (action.type) {
|
||||
case SET_AVAILABLE_SKINS:
|
||||
return { ...state, availableSkins: action.skins };
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
import settings from "./settings";
|
||||
|
||||
const reducer = combineReducers({
|
||||
userInput,
|
||||
|
|
|
|||
16
js/reducers/settings.js
Normal file
16
js/reducers/settings.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { SET_AVAILABLE_SKINS } from "../actionTypes";
|
||||
|
||||
const defaultSettingsState = {
|
||||
availableSkins: []
|
||||
};
|
||||
|
||||
const settings = (state = defaultSettingsState, action) => {
|
||||
switch (action.type) {
|
||||
case SET_AVAILABLE_SKINS:
|
||||
return { ...state, availableSkins: action.skins };
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
export default settings;
|
||||
Loading…
Add table
Add a link
Reference in a new issue