broadcast-channel
Advanced tools
Comparing version 1.2.8 to 1.2.9
@@ -153,7 +153,2 @@ import { isPromise } from './util.js'; | ||
channel._addEventListeners[msgObj.type].forEach(function (obj) { | ||
/* | ||
console.log('got message for ' + channel._state.uuid); | ||
console.log('... message time:' + channel._state.uuid + ' - ' + msgObj.time); | ||
console.log('listener time:' + channel._state.uuid + ' - ' + obj.time); | ||
*/ | ||
if (msgObj.time >= obj.time) { | ||
@@ -160,0 +155,0 @@ obj.fn(msgObj.data); |
@@ -164,5 +164,3 @@ import _regeneratorRuntime from 'babel-runtime/regenerator'; | ||
server = net.createServer(function (stream) { | ||
stream.on('end', function () { | ||
// console.log('server: end'); | ||
}); | ||
stream.on('end', function () {}); | ||
@@ -181,5 +179,3 @@ stream.on('data', function (msg) { | ||
case 5: | ||
server.on('connection', function () { | ||
// console.log('server: Client connected.'); | ||
}); | ||
server.on('connection', function () {}); | ||
@@ -514,11 +510,2 @@ return _context2.abrupt('return', { | ||
export function _filterMessage(msgObj, state) { | ||
/* console.log('_filterMessage()'); | ||
console.dir(msgObj); | ||
console.log(msgObj.senderUuid === state.uuid); | ||
console.log(state.emittedMessagesIds.has(msgObj.token)); | ||
console.log(!state.messagesCallback); | ||
console.log(msgObj.time < state.messagesCallbackTime); | ||
console.log(msgObj.time < state.time);*/ | ||
if (msgObj.senderUuid === state.uuid) return false; // not send by own | ||
@@ -832,3 +819,2 @@ if (state.emittedMessagesIds.has(msgObj.token)) return false; // not already emitted | ||
}).forEach(function (otherState) { | ||
// console.log('EMIT OVER FAST PATH'); | ||
otherState.messagesCallback(messageJson); | ||
@@ -835,0 +821,0 @@ }); |
@@ -159,7 +159,2 @@ 'use strict'; | ||
channel._addEventListeners[msgObj.type].forEach(function (obj) { | ||
/* | ||
console.log('got message for ' + channel._state.uuid); | ||
console.log('... message time:' + channel._state.uuid + ' - ' + msgObj.time); | ||
console.log('listener time:' + channel._state.uuid + ' - ' + obj.time); | ||
*/ | ||
if (msgObj.time >= obj.time) { | ||
@@ -166,0 +161,0 @@ obj.fn(msgObj.data); |
@@ -86,5 +86,3 @@ 'use strict'; | ||
server = net.createServer(function (stream) { | ||
stream.on('end', function () { | ||
// console.log('server: end'); | ||
}); | ||
stream.on('end', function () {}); | ||
@@ -103,5 +101,3 @@ stream.on('data', function (msg) { | ||
case 5: | ||
server.on('connection', function () { | ||
// console.log('server: Client connected.'); | ||
}); | ||
server.on('connection', function () {}); | ||
@@ -786,11 +782,2 @@ return _context2.abrupt('return', { | ||
function _filterMessage(msgObj, state) { | ||
/* console.log('_filterMessage()'); | ||
console.dir(msgObj); | ||
console.log(msgObj.senderUuid === state.uuid); | ||
console.log(state.emittedMessagesIds.has(msgObj.token)); | ||
console.log(!state.messagesCallback); | ||
console.log(msgObj.time < state.messagesCallbackTime); | ||
console.log(msgObj.time < state.time);*/ | ||
if (msgObj.senderUuid === state.uuid) return false; // not send by own | ||
@@ -896,3 +883,2 @@ if (state.emittedMessagesIds.has(msgObj.token)) return false; // not already emitted | ||
}).forEach(function (otherState) { | ||
// console.log('EMIT OVER FAST PATH'); | ||
otherState.messagesCallback(messageJson); | ||
@@ -899,0 +885,0 @@ }); |
{ | ||
"name": "broadcast-channel", | ||
"version": "1.2.8", | ||
"version": "1.2.9", | ||
"description": "A BroadcastChannel implementation that works with new browsers, older browsers and Node.js", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/pubkey/broadcast-channel#readme", |
@@ -123,3 +123,3 @@ | ||
const BroadcastChannel = require('broadcast-channel'); | ||
const LeaderElection = require('leader-election'); | ||
const LeaderElection = require('broadcast-channel/leader-election'); | ||
const channel = new BroadcastChannel('foobar'); | ||
@@ -132,3 +132,3 @@ const elector = LeaderElection.create(channel); | ||
```js | ||
const LeaderElection = require('leader-election'); | ||
const LeaderElection = require('broadcast-channel/leader-election'); | ||
const elector = LeaderElection.create(channel); | ||
@@ -135,0 +135,0 @@ elector.awaitLeadership().then(()=> { |
@@ -159,7 +159,2 @@ import { | ||
channel._addEventListeners[msgObj.type].forEach(obj => { | ||
/* | ||
console.log('got message for ' + channel._state.uuid); | ||
console.log('... message time:' + channel._state.uuid + ' - ' + msgObj.time); | ||
console.log('listener time:' + channel._state.uuid + ' - ' + obj.time); | ||
*/ | ||
if (msgObj.time >= obj.time) { | ||
@@ -166,0 +161,0 @@ obj.fn(msgObj.data); |
@@ -147,3 +147,2 @@ /** | ||
stream.on('end', function () { | ||
// console.log('server: end'); | ||
}); | ||
@@ -162,3 +161,2 @@ | ||
server.on('connection', () => { | ||
// console.log('server: Client connected.'); | ||
}); | ||
@@ -354,11 +352,2 @@ | ||
export function _filterMessage(msgObj, state) { | ||
/* console.log('_filterMessage()'); | ||
console.dir(msgObj); | ||
console.log(msgObj.senderUuid === state.uuid); | ||
console.log(state.emittedMessagesIds.has(msgObj.token)); | ||
console.log(!state.messagesCallback); | ||
console.log(msgObj.time < state.messagesCallbackTime); | ||
console.log(msgObj.time < state.time);*/ | ||
if (msgObj.senderUuid === state.uuid) return false; // not send by own | ||
@@ -520,3 +509,2 @@ if (state.emittedMessagesIds.has(msgObj.token)) return false; // not already emitted | ||
.forEach(otherState => { | ||
// console.log('EMIT OVER FAST PATH'); | ||
otherState.messagesCallback(messageJson); | ||
@@ -523,0 +511,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
202776
4813