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

react-amplitude-hooks

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-amplitude-hooks - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1

28

dist/components/AmplitudeProvider.js

@@ -13,16 +13,22 @@ "use strict";

exports.useAmplitudeContext = useAmplitudeContext;
function AmplitudeProvider(props) {
React.useEffect(function () {
if (validation_1.isValidAmplitudeInstance(props.amplitudeInstance)) {
if (props.apiKey) {
props.amplitudeInstance.init(props.apiKey);
function initAmplitude(apiKey, userId, amplitudeInstance) {
return function () {
if (validation_1.isValidAmplitudeInstance(amplitudeInstance)) {
if (apiKey) {
amplitudeInstance.init(apiKey);
}
if (props.userId) {
props.amplitudeInstance.setUserId(props.userId);
if (userId) {
amplitudeInstance.setUserId(userId);
}
}
else {
console.error('AmplitudeProvider was not provided with a valid "amplitudeInstance" prop.');
}
}, [props.apiKey, props.userId, props.amplitudeInstance]);
};
}
function AmplitudeProvider(props) {
var apiKey = props.apiKey, userId = props.userId, amplitudeInstance = props.amplitudeInstance;
var init = React.useMemo(function () { return initAmplitude(apiKey, userId, amplitudeInstance); }, [
apiKey,
userId,
amplitudeInstance
]);
init();
return (React.createElement(exports.AmplitudeContext.Provider, { value: {

@@ -29,0 +35,0 @@ amplitudeInstance: props.amplitudeInstance,

@@ -27,3 +27,3 @@ {

"types": "dist/index.d.ts",
"version": "0.9.0"
"version": "0.9.1"
}
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