score:0

return ({
  ...state,
  user: {
    ...state.user,
    isLoggedIn: action.payload.isLoggedIn
})

score:1

const rootReducer = (state = initState, action) => {
    switch(action.type){ 
        case(action.type === 'DELETE_MOVIE'):
            let newMovieList = state.movies.filter(movie => {
            return action.id !== movie.id
        })
            return {
                ...state,
                movies: newMovieList
            }
        case(action.type === 'LOG_IN'):
            return (
                ...state, 
                user: {
                   ...state.user,
                   isLoggedIn: action.isLoggedIn,
               }
            )
    }
    return state;
}

Related Query

More Query from same tag