comment out redux

This commit is contained in:
Aditya Sankaran
2019-10-30 21:55:48 -04:00
parent 84ad61b954
commit 12938e8e9a
4 changed files with 23 additions and 105 deletions

View File

@@ -1,31 +0,0 @@
import { LIKE_POST, UNLIKE_POST} from '../types';
const initialState = {
likes: [],
credentials: {}
}
export default function(state = initialState, action) {
switch (action.type) {
case LIKE_POST:
return {
...state,
likes: [
...state.likes,
{
userHandle: state.credentials.handle,
postId: action.payload.postId
}
]
}
case UNLIKE_POST:
return {
...state,
likes: state.likes.filter(
(like) => like.postId === action.payload.postId
)
};
default:
return state;
}
}