@devboldly/react-use-google-analytics-embed-api
Advanced tools
Comparing version 0.0.40 to 0.0.41
@@ -45,3 +45,5 @@ "use strict"; | ||
var aborted = false; | ||
var randNum = Math.random() * 1000000; | ||
var authorizedListener = function (isAuthorized) { | ||
console.log('useAnalyticsApi calling setAuthorized', randNum, 'aborted?', aborted); | ||
if (!aborted) { | ||
@@ -53,2 +55,3 @@ setAuthorized(isAuthorized); | ||
var readyListener = function () { | ||
console.log('useAnalyticsApi calling setGapi and setHookReady', randNum, 'aborted?', aborted); | ||
if (!aborted) { | ||
@@ -61,2 +64,3 @@ setGapi(exports.apiSingleton.gapi); | ||
return function () { | ||
aborted = true; | ||
exports.apiStateEmitter.off('authorized', authorizedListener); | ||
@@ -63,0 +67,0 @@ exports.apiStateEmitter.off('ready', readyListener); |
@@ -30,3 +30,3 @@ "use strict"; | ||
var authorizedListener = function (isAuthorized) { | ||
console.log('Calling setAuthorized', randNum, 'aborted?', aborted); | ||
console.log('useAuthorize calling setAuthorized', randNum, 'aborted?', aborted); | ||
if (!aborted) { | ||
@@ -39,2 +39,3 @@ setAuthorized(isAuthorized); | ||
return function () { | ||
aborted = true; | ||
console.log('Removing setAuthorized listener...', randNum); | ||
@@ -41,0 +42,0 @@ useAnalyticsApi_1.apiStateEmitter.off('authorized', authorizedListener); |
{ | ||
"name": "@devboldly/react-use-google-analytics-embed-api", | ||
"version": "0.0.40", | ||
"version": "0.0.41", | ||
"author": "Dev Boldly <devboldly@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "React hook for loading the Google Analytics Embed API.", |
92607
2094