Skip to content

Commit

Permalink
ECMAScript 6+ Refactor
Browse files Browse the repository at this point in the history
Hey, @zanonnicola! I've made some changes on lines 25 and 26. What do you think?

P.S: This pull request was sent through my cell phone and I can not test it.
  • Loading branch information
Gabriel Kalani authored and zanonnicola committed Feb 25, 2019
1 parent 2140d02 commit ce7c34b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Expand Up @@ -22,8 +22,8 @@ class Battery extends Component {
this.setState({ battery: percentage });
});
}
getBatteryLevel(battery) {
return parseFloat((battery.level * 100).toFixed(2));
getBatteryLevel({level}) {
return parseFloat((level * 100).toFixed(2));
}
handleChange() {
this.setBatteryState();
Expand Down Expand Up @@ -57,4 +57,4 @@ if (process.env.NODE_ENV !== "production") {
};
}

export default Battery;
export default Battery;

0 comments on commit ce7c34b

Please sign in to comment.