Comparing version 1.0.7 to 1.0.8
14
index.js
@@ -22,5 +22,5 @@ const ERROR_NO_NAV_VIBRATE = 'No vibration API present'; | ||
} | ||
if (_vibrateInterval) { | ||
if (_vibrateInterval) { | ||
clearInterval(_vibrateInterval); | ||
_vibrateInterval = null | ||
} | ||
@@ -64,7 +64,9 @@ | ||
_repeatVibrate(duration); | ||
_vibrateInterval = setInterval(() => { | ||
_repeatVibrate(duration); | ||
}, interval); | ||
vibrating = true; | ||
if (!_vibrateInterval) { | ||
_vibrateInterval = setInterval(() => { | ||
_repeatVibrate(duration); | ||
}, interval); | ||
vibrating = true; | ||
} | ||
} | ||
@@ -71,0 +73,0 @@ |
{ | ||
"name": "piez", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Simple mobile browser library for toggling vibration.", | ||
@@ -10,2 +10,3 @@ "main": "index.js", | ||
"scripts": { | ||
"build": "browserify -o docs/bundle.js ./index.js -s Piez", | ||
"lint": "xo", | ||
@@ -35,2 +36,3 @@ "lint:fix": "xo --fix", | ||
"devDependencies": { | ||
"browserify": "^17.0.0", | ||
"codecov": "^3.8.1", | ||
@@ -37,0 +39,0 @@ "jest": "^26.6.3", |
@@ -11,2 +11,19 @@ # Piez | ||
## Node installation | ||
```shell | ||
npm i piez | ||
``` | ||
## Example | ||
```javascript | ||
import { | ||
isVibrating, | ||
startVibrate, | ||
stopVibrate, | ||
toggleVibrate | ||
} from 'piez' | ||
``` | ||
## Credit | ||
@@ -13,0 +30,0 @@ |
4810
68
32
4