react-gapi-auth2
Version:
React bindings for gapi.auth2 (Google's OAuth 2.0 JavaScript client)
23 lines (22 loc) • 788 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadGooglePlatform = void 0;
var GOOGLE_API_PLATFORM_LIBRARY = "https://apis.google.com/js/platform.js";
var loadGooglePlatform = function (
// eslint-disable-next-line no-undef
onLoad,
// eslint-disable-next-line no-undef
onError) {
var script = document.createElement("script");
script.src = GOOGLE_API_PLATFORM_LIBRARY;
script.async = true;
script.defer = true;
script.addEventListener("load", onLoad);
script.addEventListener("error", onError);
document.body.appendChild(script);
return function () {
script.removeEventListener("load", onLoad);
script.removeEventListener("error", onError);
};
};
exports.loadGooglePlatform = loadGooglePlatform;
;