Skip to content

Commit

Permalink
Spread operator babel support added
Browse files Browse the repository at this point in the history
  • Loading branch information
tavyandy97 committed Apr 12, 2020
1 parent 2dcdcf9 commit 08a464f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 36 deletions.
5 changes: 3 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"presets": ["es2015"]
}
"presets": ["es2015"],
"plugins": ["transform-es2015-destructuring", "transform-object-rest-spread"]
}
34 changes: 0 additions & 34 deletions event/src/reducers/API/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,6 @@ export default (state = initialState, action) => {
}),
},
};
// let tempState = JSON.parse(JSON.stringify(state));
// tempState[action.reducerDetails.repoName][
// action.reducerDetails.branchName
// ] = action.payload.map((node) => {
// return {
// name: node.name,
// path: node.path.split("/").filter((pathSub) => pathSub.length !== 0),
// isTree:
// node.type === "tree"
// ? {
// isOpen: false,
// }
// : false,
// };
// });
// return tempState;
// return Object.assign({}, state, {
// [action.reducerDetails.repoName]: {
// [action.reducerDetails.branchName]: action.payload.map((node) => {
// return {
// name: node.name,
// path: node.path
// .split("/")
// .filter((pathSub) => pathSub.length !== 0),
// isTree:
// node.type === "tree"
// ? {
// isOpen: false,
// }
// : false,
// };
// }),
// },
// });
default:
return state;
}
Expand Down
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"devDependencies": {
"babel-core": "^6.24.1",
"babel-loader": "^7.0.0",
"babel-plugin-transform-es2015-destructuring": "^6.23.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"css-loader": "^3.4.2",
Expand Down

0 comments on commit 08a464f

Please sign in to comment.