react-use-hotjar
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -5,2 +5,9 @@ # Changelog | ||
### [1.0.4](https://github.com/olavoparno/react-use-hotjar/compare/v1.0.3...v1.0.4) (2020-08-11) | ||
### Bug Fixes | ||
* **project:** fix lots of things ([76aabd6](https://github.com/olavoparno/react-use-hotjar/commit/76aabd67e9b51b8a75cf4f3925a455de1271bddc)) | ||
### [1.0.3](https://github.com/olavoparno/react-use-hotjar/compare/v1.0.2...v1.0.3) (2020-08-11) | ||
@@ -7,0 +14,0 @@ |
import { useMemo, useCallback } from 'react'; | ||
function useAppendHeadScript() { | ||
var appendHeadScript = function (_a) { | ||
var appendHeadScript = useCallback(function (_a) { | ||
var scriptText = _a.scriptText, scriptId = _a.scriptId; | ||
@@ -15,7 +15,7 @@ try { | ||
} | ||
catch (error) { | ||
return error; | ||
catch (_b) { | ||
return false; | ||
} | ||
}; | ||
return useMemo(function () { return ({ appendHeadScript: appendHeadScript }); }, []); | ||
}, []); | ||
return useMemo(function () { return ({ appendHeadScript: appendHeadScript }); }, [appendHeadScript]); | ||
} | ||
@@ -39,3 +39,3 @@ | ||
try { | ||
var hotjarIdentityScript = "var userId=\"" + userId + "\" || null;window.hj(\"identify\",userId,{" + userInfo + "}});"; | ||
var hotjarIdentityScript = "var userId=\"" + userId + "\" || null;window.hj(\"identify\",userId," + userInfo + ");"; | ||
var isIdentified = appendHeadScript({ | ||
@@ -42,0 +42,0 @@ scriptText: hotjarIdentityScript, |
@@ -8,3 +8,3 @@ 'use strict'; | ||
function useAppendHeadScript() { | ||
var appendHeadScript = function (_a) { | ||
var appendHeadScript = React.useCallback(function (_a) { | ||
var scriptText = _a.scriptText, scriptId = _a.scriptId; | ||
@@ -20,7 +20,7 @@ try { | ||
} | ||
catch (error) { | ||
return error; | ||
catch (_b) { | ||
return false; | ||
} | ||
}; | ||
return React.useMemo(function () { return ({ appendHeadScript: appendHeadScript }); }, []); | ||
}, []); | ||
return React.useMemo(function () { return ({ appendHeadScript: appendHeadScript }); }, [appendHeadScript]); | ||
} | ||
@@ -44,3 +44,3 @@ | ||
try { | ||
var hotjarIdentityScript = "var userId=\"" + userId + "\" || null;window.hj(\"identify\",userId,{" + userInfo + "}});"; | ||
var hotjarIdentityScript = "var userId=\"" + userId + "\" || null;window.hj(\"identify\",userId," + userInfo + ");"; | ||
var isIdentified = appendHeadScript({ | ||
@@ -47,0 +47,0 @@ scriptText: hotjarIdentityScript, |
{ | ||
"name": "react-use-hotjar", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Add Hotjar capabilities as custom hooks", | ||
@@ -5,0 +5,0 @@ "author": "Olavo Parno", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
19340
0