webamp/js/reducers/settings.ts
2019-03-19 06:55:24 -07:00

24 lines
503 B
TypeScript

import { Action, Skin } from "../types";
import { SET_AVAILABLE_SKINS } from "../actionTypes";
export interface SettingsState {
availableSkins: Array<Skin>;
}
const defaultSettingsState = {
availableSkins: [],
};
const settings = (
state: SettingsState = defaultSettingsState,
action: Action
): SettingsState => {
switch (action.type) {
case SET_AVAILABLE_SKINS:
return { ...state, availableSkins: action.skins };
default:
return state;
}
};
export default settings;