You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tp_ReactNative/JokesApp/redux/reducers/categoryReducer.ts

22 lines
545 B

import {Action, CategoriesActionType} from "../actions/categoriesAction";
import {Categorie} from "../../model/Categorie";
interface State {
categories: Categorie[];
}
const initialState: State = {
categories: [],
}
// @ts-ignore
export default appReducer = (state = initialState, action: Action) => {
switch (action.type) {
case CategoriesActionType.FETCH_CATEGORIES:
return {
...state,
categories: action.payload
}
default:
return state;
}
}