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

@bufferapp/analytics-middleware

Package Overview
Dependencies
Maintainers
24
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bufferapp/analytics-middleware - npm Package Compare versions

Comparing version 0.91.0 to 0.91.2

10

actions.js
import keyWrapper from '@bufferapp/keywrapper';
export const actionTypes = keyWrapper('ANALYTICS', {
INIT: 'INIT',
PAGE_CHANGE: 'PAGE_CHANGE',
TRACK_EVENT: 'TRACK_EVENT',
INIT: 'INIT',
});

@@ -23,4 +24,11 @@

},
pageChange(pageName, payload) {
return {
type: actionTypes.PAGE_CHANGE,
pageName,
payload,
};
},
};
export default actions;

@@ -23,2 +23,12 @@ import { actions, actionTypes } from './actions';

});
it('pageChange triggers PAGE_CHANGE with pageName and payload', () => {
const pageName = 'page 1';
const payload = { foo: 'foo' };
expect(actions.pageChange(pageName, payload)).toEqual({
type: actionTypes.PAGE_CHANGE,
pageName,
payload,
});
});
});

@@ -19,2 +19,11 @@ import { actionTypes } from './actions';

break;
case actionTypes.PAGE_CHANGE:
if (window.analytics) {
window.analytics.page(
action.pageName,
Object.assign({
product: window.PRODUCT_TRACKING_KEY,
}, action.payload));
}
break;
default:

@@ -21,0 +30,0 @@ break;

@@ -59,2 +59,18 @@ import './analytics.mock';

});
it(`On ${actionTypes.PAGE_CHANGE} should push a page change to segment`, () => {
const action = {
type: actionTypes.PAGE_CHANGE,
pageName: 'page foo',
payload: {
bar: 'bar',
},
};
middleware(store)(next)(action);
expect(window.analytics.page)
.toHaveBeenCalledWith(action.pageName, {
bar: 'bar',
product: 'analyze',
});
});
});

2

package.json
{
"name": "@bufferapp/analytics-middleware",
"version": "0.91.0",
"version": "0.91.2",
"description": "Analyze Demographic Data Store",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

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