Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@devboldly/react-use-google-analytics-embed-api

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devboldly/react-use-google-analytics-embed-api - npm Package Compare versions

Comparing version 0.0.25 to 0.0.26

dist/hooks/useAnalyticsApi.d.ts

15

dist/hooks/useDataChart.js

@@ -24,7 +24,12 @@ "use strict";

if (query.ids) {
var newChart = new gapi.analytics.googleCharts.DataChart({
query: query,
chart: chart,
});
setDataChart(newChart);
try {
var newChart = new gapi.analytics.googleCharts.DataChart({
query: query,
chart: chart,
});
setDataChart(newChart);
}
catch (e) {
console.log(e);
}
}

@@ -31,0 +36,0 @@ }

@@ -1,2 +0,2 @@

import { GoogleAnalyticsEmbedAPILoader } from './useGoogleAnalyticsEmbedApi';
import { GoogleAnalyticsEmbedAPILoader } from './useAnalyticsApi';
export declare const useViewSelector: (gapiLoader: GoogleAnalyticsEmbedAPILoader, viewSelectorId: string, onChange: (viewId: string) => void) => void;

@@ -16,18 +16,23 @@ "use strict";

if (gapiLoader.ready && gapiLoader.gapi) {
/**
* Create a new ViewSelector instance to be rendered inside of an
* element with the id "view-selector-container".
*/
var newViewSelector = new gapiLoader.gapi.analytics.ViewSelector({
container: viewSelectorId,
});
// Render the view selector to the page.
newViewSelector.execute();
/**
* Render the dataChart on the page whenever a new view is selected.
*/
newViewSelector.on('change', function (viewId) {
onChange(viewId);
});
setViewSelector(newViewSelector);
try {
/**
* Create a new ViewSelector instance to be rendered inside of an
* element with the id provided.
*/
var newViewSelector = new gapiLoader.gapi.analytics.ViewSelector({
container: viewSelectorId,
});
// Render the view selector to the page.
newViewSelector.execute();
/**
* Render the dataChart on the page whenever a new view is selected.
*/
newViewSelector.on('change', function (viewId) {
onChange(viewId);
});
setViewSelector(newViewSelector);
}
catch (e) {
console.log(e);
}
}

@@ -34,0 +39,0 @@ }

export * from './hooks/GoogleAnalyticsEmbedAPI';
export * from './hooks/useAuthAuthorize';
export * from './hooks/useAuthorized';
export * from './hooks/useAnalyticsApi';
export * from './hooks/useAuthorize';
export * from './hooks/useDataChart';
export * from './hooks/useGoogleAnalyticsEmbedApi';
export * from './hooks/useViewSelector';

@@ -6,6 +6,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./hooks/useAuthAuthorize"));
__export(require("./hooks/useAuthorized"));
__export(require("./hooks/useAnalyticsApi"));
__export(require("./hooks/useAuthorize"));
__export(require("./hooks/useDataChart"));
__export(require("./hooks/useGoogleAnalyticsEmbedApi"));
__export(require("./hooks/useViewSelector"));
{
"name": "@devboldly/react-use-google-analytics-embed-api",
"version": "0.0.25",
"version": "0.0.26",
"author": "Dev Boldly <devboldly@gmail.com>",

@@ -5,0 +5,0 @@ "description": "React hook to async load the Google Analytics Embed API.",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc