Skip to content

Commit

Permalink
use stepTimer instead of window.setTimeout, see phetsims/phet-info#59
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Mar 18, 2021
1 parent 6feaa71 commit ad3a75a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/john-travoltage/view/vibrationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import BooleanProperty from '../../../../axon/js/BooleanProperty.js';
import stepTimer from '../../../../axon/js/Timer.js';
import johnTravoltage from '../../johnTravoltage.js';

// constants
Expand Down Expand Up @@ -108,10 +109,10 @@ class VibrationController {
// consider a way to queue these requests with timing rather than using a timeout
const resetVibrationInterval = 150; // ms
vibrationManager.vibrateTransient();
window.setTimeout( () => {
stepTimer.setTimeout( () => {
vibrationManager.vibrateTransient();

window.setTimeout( () => {
stepTimer.setTimeout( () => {
vibrationManager.vibrateTransient();
}, resetVibrationInterval );
}, resetVibrationInterval );
Expand Down

0 comments on commit ad3a75a

Please sign in to comment.