brutal-legends/src/reducers/sort-key.ts
2020-03-05 20:14:09 +01:00

17 lines
329 B
TypeScript

import { SET_SORT_KEY } from "../actions";
type Action = {
type: string;
payload: {
key: string;
};
};
export default (state: string = "id", action: Action) => {
switch (action.type) {
case SET_SORT_KEY:
return action.payload.key;
default:
return state;
}
};