react-hotjar
Advanced tools
Comparing version 6.0.0 to 6.1.0
21
index.js
@@ -1,27 +0,26 @@ | ||
import hotjar from './src/react-hotjar'; | ||
import hotjarLib from './src/react-hotjar'; | ||
function hj() { | ||
const params = Array.prototype.slice.call(arguments); | ||
const hj = (...params) => { | ||
if (!window.hj) { | ||
throw new Error('Hotjar is not initialized'); | ||
} | ||
window.hj.apply(undefined, params); | ||
} | ||
window.hj(...params); | ||
}; | ||
export const hotjar = { | ||
initialize: function initialize(id, sv) { | ||
hotjar(id, sv); | ||
initialize(id, sv) { | ||
hotjarLib(id, sv); | ||
}, | ||
initialized: function initialized() { | ||
initialized() { | ||
return typeof window !== 'undefined' && typeof window.hj === 'function'; | ||
}, | ||
identify: function identify(userId, properties) { | ||
identify(userId, properties) { | ||
hj('identify', userId, properties); | ||
}, | ||
event: function event(event) { | ||
event(event) { | ||
hj('event', event); | ||
}, | ||
stateChange: function stateChange(relativePath) { | ||
stateChange(relativePath) { | ||
hj('stateChange', relativePath); | ||
}, | ||
}; |
{ | ||
"name": "react-hotjar", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"description": "Small component to implement Hotjar into your react application", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
5212
79