Skip to content

Commit

Permalink
Refactoring (#3)
Browse files Browse the repository at this point in the history
* Refactoring from map to reduce

* Fixed eslintrc bug
  • Loading branch information
ovekyc authored and yuda1124 committed Jan 2, 2017
1 parent 59d4f58 commit fcd9ecb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

"parser": "babel-eslint",

"parser": "babel-eslint",

"ecmaFeatures": {
"arrowFunctions": true,
"binaryLiterals": true,
Expand Down
8 changes: 3 additions & 5 deletions app/view/clip-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ export default class ClipList extends React.Component {
}
)
});
let data = '';
this.state.logs.map((log, i)=>{
if (index !== i) data = `${data}${log}\n`;
});
ipcRenderer.send('delete-log', data);
const updatedData = this.state.logs.reduce((data, log, i) =>
i === index ? data : `${data}${log}\n`);
ipcRenderer.send('delete-log', updatedData);
}

readFile() {
Expand Down

0 comments on commit fcd9ecb

Please sign in to comment.