Skip to content

Commit e750bb6

Browse files
authored
added StartSimulation to sliders
1 parent cb5d67a commit e750bb6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/TrainSimulator.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ function useSimulation() {
2222

2323
function handleSpeedChange(event) {
2424
setSpeed(parseInt(event.target.value));
25+
startSimulation();
2526
}
2627

2728
function handleThrottleChange(event) {
2829
setThrottle(parseInt(event.target.value));
30+
startSimulation();
2931
}
3032

3133
function handlePressureChange(event) {
3234
setPressure(parseInt(event.target.value));
35+
startSimulation();
3336
}
3437

3538
return {

0 commit comments

Comments
 (0)