Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #43 from niklassaers/master
Browse files Browse the repository at this point in the history
enthusiasmLevel should not be below zero
  • Loading branch information
Orta committed Jul 11, 2019
2 parents ef79726 + a7d9800 commit b90f7c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class Hello extends React.Component<Props, State> {
}

onIncrement = () => this.setState({ enthusiasmLevel: this.state.enthusiasmLevel + 1 });
onDecrement = () => this.setState({ enthusiasmLevel: this.state.enthusiasmLevel - 1 });
onDecrement = () => this.setState({ enthusiasmLevel: Math.max(0, this.state.enthusiasmLevel - 1) });
getExclamationMarks = (numChars: number) => Array(numChars + 1).join("!")

render() {
Expand Down

0 comments on commit b90f7c3

Please sign in to comment.