(isEnabled = true)
| 106 | }; |
| 107 | |
| 108 | const enable = (isEnabled = true) => { |
| 109 | if (!isEnabled) { |
| 110 | if (rmTouchStart) { |
| 111 | rmTouchStart(); |
| 112 | } |
| 113 | if (rmMouseStart) { |
| 114 | rmMouseStart(); |
| 115 | } |
| 116 | rmTouchStart = rmMouseStart = undefined; |
| 117 | stop(); |
| 118 | } else { |
| 119 | if (!rmTouchStart) { |
| 120 | rmTouchStart = addEventListener(el, 'touchstart', handleTouchStart, options); |
| 121 | } |
| 122 | if (!rmMouseStart) { |
| 123 | rmMouseStart = addEventListener(el, 'mousedown', handleMouseDown, options); |
| 124 | } |
| 125 | } |
| 126 | }; |
| 127 | |
| 128 | const destroy = () => { |
| 129 | enable(false); |
no test coverage detected