subscribe-ui-event
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -7,4 +7,7 @@ /** | ||
import assign from 'lodash/assign'; | ||
import { supportPassiveEvent } from '../globalVars'; | ||
import globalVars from '../globalVars'; | ||
const supportPassiveEvent = globalVars.supportPassiveEvent; | ||
const defaultEventOption = { | ||
@@ -11,0 +14,0 @@ capture: false, |
@@ -6,4 +6,6 @@ /** | ||
import { removers } from './globalVars'; | ||
import globalVars from './globalVars'; | ||
const removers = globalVars.removers; | ||
/** | ||
@@ -15,2 +17,3 @@ * Unsubscribe to UI events. | ||
*/ | ||
function unsubscribe(type, cb) { | ||
@@ -17,0 +20,0 @@ let remover; |
@@ -13,2 +13,4 @@ 'use strict'; | ||
var _globalVars2 = _interopRequireDefault(_globalVars); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -21,2 +23,5 @@ | ||
var supportPassiveEvent = _globalVars2.default.supportPassiveEvent; | ||
var defaultEventOption = { | ||
@@ -42,3 +47,3 @@ capture: false, | ||
var eventOptions = _globalVars.supportPassiveEvent ? (0, _assign2.default)({}, defaultEventOption, options) : false; | ||
var eventOptions = supportPassiveEvent ? (0, _assign2.default)({}, defaultEventOption, options) : false; | ||
@@ -45,0 +50,0 @@ if (!target.addEventListener && target.attachEvent) { |
@@ -9,2 +9,8 @@ 'use strict'; | ||
var _globalVars2 = _interopRequireDefault(_globalVars); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var removers = _globalVars2.default.removers; | ||
/** | ||
@@ -16,17 +22,19 @@ * Unsubscribe to UI events. | ||
*/ | ||
/** | ||
* Copyright 2015, Yahoo! Inc. | ||
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. | ||
*/ | ||
function unsubscribe(type, cb) { | ||
var remover = void 0; | ||
for (var i = _globalVars.removers.length - 1; i >= 0; i -= 1) { | ||
remover = _globalVars.removers[i]; | ||
for (var i = removers.length - 1; i >= 0; i -= 1) { | ||
remover = removers[i]; | ||
if (remover._cb === cb && remover._type.indexOf(type) >= 0) { | ||
remover.unsubscribe(); | ||
_globalVars.removers.splice(i, 1); | ||
removers.splice(i, 1); | ||
} | ||
} | ||
} /** | ||
* Copyright 2015, Yahoo! Inc. | ||
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. | ||
*/ | ||
} | ||
exports.default = unsubscribe; | ||
module.exports = exports['default']; |
{ | ||
"name": "subscribe-ui-event", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "A single, throttle built-in solution to subscribe to browser UI Events.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
264872
1028
0