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

@pga/react-intercom

Package Overview
Dependencies
Maintainers
16
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pga/react-intercom - npm Package Compare versions

Comparing version 0.1.0-alpha.1 to 0.1.0-alpha.2

src/__tests__/index.test.js

16

dist/index.js

@@ -19,3 +19,3 @@ (function (global, factory) {

});
exports.IntercomAPI = undefined;
exports.Intercom = exports.IntercomAPI = undefined;

@@ -52,3 +52,3 @@ var _extends3 = _interopRequireDefault(_extends2);

var Intercom = function (_React$Component) {
var Intercom = exports.Intercom = function (_React$Component) {
(0, _inherits3.default)(Intercom, _React$Component);

@@ -66,5 +66,7 @@

appId = _props.appId,
data = _props.data;
data = _props.data,
_props$intercom = _props.intercom,
intercom = _props$intercom === undefined ? IntercomAPI : _props$intercom;
IntercomAPI('boot', (0, _extends3.default)({ app_id: appId }, data));
intercom('boot', (0, _extends3.default)({ app_id: appId }, data));
}

@@ -82,4 +84,8 @@ }, {

var _props$intercom2 = this.props.intercom,
intercom = _props$intercom2 === undefined ? IntercomAPI : _props$intercom2;
if (currentURL && previousURL && currentURL !== previousURL) {
IntercomAPI('update');
intercom('update');
}

@@ -86,0 +92,0 @@ }

{
"name": "@pga/react-intercom",
"version": "0.1.0-alpha.1",
"version": "0.1.0-alpha.2",
"description": "React Intercom Component",
"main": "dist/index.js",
"scripts": {
"build": "./node_modules/.bin/babel ./src -d dist --ignore test.js,setupTests.js,mock.js"
"build": "./node_modules/.bin/babel ./src -d dist --ignore test.js,setupTests.js,mock.js",
"lint": "npx standard",
"test": "jest --env=jsdom"
},

@@ -30,4 +32,11 @@ "devDependencies": {

},
"jest": {
"setupFiles": [
"<rootDir>/src/setupTests.js"
],
"testEnvironment": "jsdom",
"testURL": "https://pga.org"
},
"author": "",
"license": "ISC"
}

@@ -12,6 +12,6 @@ import React from 'react'

class Intercom extends React.Component {
export class Intercom extends React.Component {
componentDidMount () {
const { appId, data } = this.props
IntercomAPI('boot', { app_id: appId, ...data })
const { appId, data, intercom = IntercomAPI } = this.props
intercom('boot', { app_id: appId, ...data })
}

@@ -22,5 +22,6 @@

const { pathname: currentURL } = this.props.location || {}
const { intercom = IntercomAPI } = this.props
if (currentURL && previousURL && currentURL !== previousURL) {
IntercomAPI('update')
intercom('update')
}

@@ -27,0 +28,0 @@ }

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