@devboldly/react-use-google-analytics-embed-api
Advanced tools
Comparing version 0.0.41 to 0.0.42
@@ -13,3 +13,2 @@ "use strict"; | ||
var React = __importStar(require("react")); | ||
console.log('Creating API singleton...'); | ||
/** | ||
@@ -46,5 +45,3 @@ * Contains gapi and tracks whether the script was requested and if we're authorized. | ||
var aborted = false; | ||
var randNum = Math.random() * 1000000; | ||
var authorizedListener = function (isAuthorized) { | ||
console.log('useAnalyticsApi calling setAuthorized', randNum, 'aborted?', aborted); | ||
if (!aborted) { | ||
@@ -56,3 +53,2 @@ setAuthorized(isAuthorized); | ||
var readyListener = function () { | ||
console.log('useAnalyticsApi calling setGapi and setHookReady', randNum, 'aborted?', aborted); | ||
if (!aborted) { | ||
@@ -59,0 +55,0 @@ setGapi(exports.apiSingleton.gapi); |
@@ -28,9 +28,6 @@ "use strict"; | ||
var aborted = false; | ||
var randNum = Math.random() * 1000000; | ||
var authorizedListener = function (isAuthorized) { | ||
console.log('useAuthorize calling setAuthorized', randNum, 'aborted?', aborted); | ||
if (!aborted) { | ||
setAuthorized(isAuthorized); | ||
} | ||
console.log('Stats from', randNum, ' - Called for:', useAnalyticsApi_1.apiStateEmitter.listenerCount('authorized'), 'listeners.'); | ||
}; | ||
@@ -40,3 +37,2 @@ useAnalyticsApi_1.apiStateEmitter.on('authorized', authorizedListener); | ||
aborted = true; | ||
console.log('Removing setAuthorized listener...', randNum); | ||
useAnalyticsApi_1.apiStateEmitter.off('authorized', authorizedListener); | ||
@@ -43,0 +39,0 @@ }; |
{ | ||
"name": "@devboldly/react-use-google-analytics-embed-api", | ||
"version": "0.0.41", | ||
"version": "0.0.42", | ||
"author": "Dev Boldly <devboldly@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "React hook for loading the Google Analytics Embed API.", |
91960
2086