@segment/analytics.js-core
Advanced tools
Comparing version 3.10.0 to 3.10.1
@@ -19,3 +19,2 @@ 'use strict'; | ||
var Track = require('segmentio-facade').Track; | ||
var after = require('@ndhoule/after'); | ||
var bindAll = require('bind-all'); | ||
@@ -190,7 +189,11 @@ var clone = require('@ndhoule/clone'); | ||
// make ready callback | ||
var readyCallCount = 0; | ||
var integrationCount = keys(integrations).length; | ||
var ready = after(integrationCount, function() { | ||
self._readied = true; | ||
self.emit('ready'); | ||
}); | ||
var ready = function() { | ||
readyCallCount++; | ||
if (readyCallCount >= integrationCount) { | ||
self._readied = true; | ||
self.emit('ready'); | ||
} | ||
}; | ||
@@ -205,2 +208,3 @@ // init if no integrations | ||
this.failedInitializations = []; | ||
var initialPageSkipped = false; | ||
each(function(integration) { | ||
@@ -211,6 +215,15 @@ if ( | ||
) { | ||
integration.page = after(2, integration.page); | ||
// We've assumed one initial pageview, so make sure we don't count the first page call. | ||
var page = integration.page; | ||
integration.page = function() { | ||
if (initialPageSkipped) { | ||
return page.apply(this, arguments); | ||
} | ||
initialPageSkipped = true; | ||
return; | ||
}; | ||
} | ||
integration.analytics = self; | ||
integration.once('ready', ready); | ||
@@ -232,2 +245,3 @@ try { | ||
// Mark integration as ready to prevent blocking of anyone listening to analytics.ready() | ||
integration.ready(); | ||
@@ -234,0 +248,0 @@ } |
{ | ||
"name": "@segment/analytics.js-core", | ||
"author": "Segment <friends@segment.com>", | ||
"version": "3.10.0", | ||
"version": "3.10.1", | ||
"description": "The hassle-free way to integrate analytics into any web application.", | ||
@@ -32,3 +32,2 @@ "keywords": [ | ||
"dependencies": { | ||
"@ndhoule/after": "^1.0.0", | ||
"@ndhoule/clone": "^1.0.0", | ||
@@ -35,0 +34,0 @@ "@ndhoule/defaults": "^2.0.1", |
Sorry, the diff of this file is too big to display
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
474942
35
5601
- Removed@ndhoule/after@^1.0.0
- Removed@ndhoule/after@1.0.0(transitive)
- Removed@ndhoule/arity@2.0.0(transitive)