broadcast-channel
Advanced tools
Comparing version 1.2.9 to 1.2.10
import { sleep, randomToken } from '../util.js'; | ||
import unload from 'unload'; | ||
import * as unload from 'unload'; | ||
@@ -148,3 +148,3 @@ var LeaderElection = function LeaderElection(channel, options) { | ||
this._unloads.forEach(function (uFn) { | ||
uFn(); | ||
uFn.remove(); | ||
}); | ||
@@ -151,0 +151,0 @@ return this._sendMessage('death'); |
@@ -19,3 +19,3 @@ import _regeneratorRuntime from 'babel-runtime/regenerator'; | ||
import isNode from 'detect-node'; | ||
import unload from 'unload'; | ||
var unload = require('unload'); | ||
@@ -837,3 +837,5 @@ import { fillOptionsWithDefaults } from '../options'; | ||
if (typeof channelState.removeUnload === 'function') channelState.removeUnload(); | ||
if (channelState.removeUnload) { | ||
channelState.removeUnload.remove(); | ||
} | ||
@@ -840,0 +842,0 @@ /** |
@@ -12,5 +12,5 @@ 'use strict'; | ||
var _unload2 = _interopRequireDefault(_unload); | ||
var unload = _interopRequireWildcard(_unload); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } | ||
@@ -160,3 +160,3 @@ var LeaderElection = function LeaderElection(channel, options) { | ||
this._unloads.forEach(function (uFn) { | ||
uFn(); | ||
uFn.remove(); | ||
}); | ||
@@ -182,3 +182,3 @@ return this._sendMessage('death'); | ||
this.isLeader = true; | ||
var unloadFn = _unload2['default'].add(function () { | ||
var unloadFn = unload.add(function () { | ||
return _this4.die(); | ||
@@ -185,0 +185,0 @@ }); |
@@ -360,3 +360,3 @@ 'use strict'; | ||
// ensure if process crashes, everything is cleaned up | ||
removeUnload: _unload2['default'].add(function () { | ||
removeUnload: unload.add(function () { | ||
return close(state); | ||
@@ -673,6 +673,2 @@ }), | ||
var _unload = require('unload'); | ||
var _unload2 = _interopRequireDefault(_unload); | ||
var _options = require('../options'); | ||
@@ -690,2 +686,7 @@ | ||
var unload = require('unload'); /** | ||
* this method is used in nodejs-environments. | ||
* The ipc is handled via sockets and file-writes to the tmp-folder | ||
*/ | ||
/** | ||
@@ -703,6 +704,3 @@ * windows sucks, so we have handle windows-type of socket-paths | ||
} | ||
} /** | ||
* this method is used in nodejs-environments. | ||
* The ipc is handled via sockets and file-writes to the tmp-folder | ||
*/ | ||
} | ||
@@ -904,3 +902,5 @@ var mkdir = util.promisify(fs.mkdir); | ||
if (typeof channelState.removeUnload === 'function') channelState.removeUnload(); | ||
if (channelState.removeUnload) { | ||
channelState.removeUnload.remove(); | ||
} | ||
@@ -907,0 +907,0 @@ /** |
{ | ||
"name": "broadcast-channel", | ||
"version": "1.2.9", | ||
"version": "1.2.10", | ||
"description": "A BroadcastChannel implementation that works with new browsers, older browsers and Node.js", | ||
@@ -66,3 +66,3 @@ "homepage": "https://github.com/pubkey/broadcast-channel#readme", | ||
"nano-time": "1.0.0", | ||
"unload": "1.3.9" | ||
"unload": "2.0.0" | ||
}, | ||
@@ -69,0 +69,0 @@ "devDependencies": { |
32
perf.txt
@@ -207,2 +207,32 @@ BEFORE: | ||
----------------------------------------- | ||
----------------------------------------- | ||
## no default import | ||
npm run build:size | ||
BEFORE: 112358 | ||
AFTER : 112401 | ||
## only use async/await when needed | ||
BEFORE: 112401 | ||
AFTER : 111582 | ||
----------------------------------------- | ||
new unload module | ||
BEFORE: { | ||
"openClose": 765.1154530011117, | ||
"sendRecieve": { | ||
"parallel": 259.89112799987197, | ||
"series": 4052.1648419983685 | ||
} | ||
} | ||
AFTER: { | ||
"openClose": 672.2327830009162, | ||
"sendRecieve": { | ||
"parallel": 250.701522000134, | ||
"series": 4001.1675169989467 | ||
} | ||
} |
@@ -6,3 +6,3 @@ import { | ||
import unload from 'unload'; | ||
import * as unload from 'unload'; | ||
@@ -143,3 +143,3 @@ const LeaderElection = function (channel, options) { | ||
this._unloads.forEach(uFn => { | ||
uFn(); | ||
uFn.remove(); | ||
}); | ||
@@ -146,0 +146,0 @@ return this._sendMessage('death'); |
@@ -19,3 +19,3 @@ /** | ||
import isNode from 'detect-node'; | ||
import unload from 'unload'; | ||
const unload = require('unload'); | ||
@@ -524,4 +524,5 @@ import { | ||
if (typeof channelState.removeUnload === 'function') | ||
channelState.removeUnload(); | ||
if (channelState.removeUnload) { | ||
channelState.removeUnload.remove(); | ||
} | ||
@@ -528,0 +529,0 @@ /** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
203476
4817
+ Addedunload@2.0.0(transitive)
- Removedunload@1.3.9(transitive)
Updatedunload@2.0.0