showing results for - "concatenate state with previous state in react redux"
Ivanna
22 Sep 2018
1const Initial_State = { images: [] };
2
3export default (state = Initial_State, action) => {
4
5    switch (action.type) {
6
7        case 'ImagesFetch':
8
9            return {
10                ...state,
11                images: [...state.images, action.payload]
12            };
13
14        default:
15            return state;
16    }
17}
18
19
similar questions