@marvelapp/react-ab-test
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -18,5 +18,5 @@ "use strict"; | ||
if (_ExecutionEnvironment.canUseDOM) { | ||
if (typeof mixpanel === "undefined") { | ||
if (typeof mixpanel === 'undefined') { | ||
var error = new Error("React A/B Test Mixpanel Helper: 'mixpanel' global is not defined."); | ||
error.type = "PUSHTELL_HELPER_MISSING_GLOBAL"; | ||
error.type = 'PUSHTELL_HELPER_MISSING_GLOBAL'; | ||
throw error; | ||
@@ -26,15 +26,15 @@ } | ||
playSubscription = _emitter["default"].addPlayListener(function (experimentName, variantName) { | ||
mixpanel.track("Experiment Play", { | ||
"Experiment": experimentName, | ||
"Variant": variantName | ||
mixpanel.track('Experiment Play', { | ||
Experiment: experimentName, | ||
Variant: variantName | ||
}, function () { | ||
_emitter["default"].emit("mixpanel-play", experimentName, variantName); | ||
_emitter["default"].emit('mixpanel-play', experimentName, variantName); | ||
}); | ||
}); | ||
winSubscription = _emitter["default"].addWinListener(function (experimentName, variantName) { | ||
mixpanel.track("Experiment Win", { | ||
"Experiment": experimentName, | ||
"Variant": variantName | ||
mixpanel.track('Experiment Win', { | ||
Experiment: experimentName, | ||
Variant: variantName | ||
}, function () { | ||
_emitter["default"].emit("mixpanel-win", experimentName, variantName); | ||
_emitter["default"].emit('mixpanel-win', experimentName, variantName); | ||
}); | ||
@@ -47,4 +47,4 @@ }); | ||
if (!playSubscription || !winSubscription) { | ||
var error = new Error("React A/B Test Mixpanel Helper: Helper was not enabled."); | ||
error.type = "PUSHTELL_HELPER_INVALID_DISABLE"; | ||
var error = new Error('React A/B Test Mixpanel Helper: Helper was not enabled.'); | ||
error.type = 'PUSHTELL_HELPER_INVALID_DISABLE'; | ||
throw error; | ||
@@ -51,0 +51,0 @@ } |
@@ -18,5 +18,5 @@ "use strict"; | ||
if (_ExecutionEnvironment.canUseDOM) { | ||
if (typeof analytics === "undefined") { | ||
if (typeof analytics === 'undefined') { | ||
var error = new Error("React A/B Test Segment Helper: 'analytics' global is not defined."); | ||
error.type = "PUSHTELL_HELPER_MISSING_GLOBAL"; | ||
error.type = 'PUSHTELL_HELPER_MISSING_GLOBAL'; | ||
throw error; | ||
@@ -26,15 +26,15 @@ } | ||
playSubscription = _emitter["default"].addPlayListener(function (experimentName, variantName) { | ||
analytics.track("Experiment Viewed", { | ||
"experimentName": experimentName, | ||
"variationName": variantName | ||
analytics.track('Experiment Viewed', { | ||
experimentName: experimentName, | ||
variationName: variantName | ||
}, function () { | ||
_emitter["default"].emit("segment-play", experimentName, variantName); | ||
_emitter["default"].emit('segment-play', experimentName, variantName); | ||
}); | ||
}); | ||
winSubscription = _emitter["default"].addWinListener(function (experimentName, variantName) { | ||
analytics.track("Experiment Won", { | ||
"experimentName": experimentName, | ||
"variationName": variantName | ||
analytics.track('Experiment Won', { | ||
experimentName: experimentName, | ||
variationName: variantName | ||
}, function () { | ||
_emitter["default"].emit("segment-win", experimentName, variantName); | ||
_emitter["default"].emit('segment-win', experimentName, variantName); | ||
}); | ||
@@ -47,4 +47,4 @@ }); | ||
if (!playSubscription || !winSubscription) { | ||
var error = new Error("React A/B Test Segment Helper: Helper was not enabled."); | ||
error.type = "PUSHTELL_HELPER_INVALID_DISABLE"; | ||
var error = new Error('React A/B Test Segment Helper: Helper was not enabled.'); | ||
error.type = 'PUSHTELL_HELPER_INVALID_DISABLE'; | ||
throw error; | ||
@@ -51,0 +51,0 @@ } |
@@ -50,3 +50,3 @@ "use strict"; | ||
var variantListener = _emitter["default"].addActiveVariantListener(experimentName, function (name, variant) { | ||
if (name === experimentName) { | ||
if (name === experimentName && variant !== activeVariant) { | ||
setActiveVariant(variant); | ||
@@ -53,0 +53,0 @@ } |
@@ -14,3 +14,3 @@ { | ||
"main": "index.js", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "A/B testing React components and debug tools. Isomorphic with a simple, universal interface. Well documented and lightweight. Tested in popular browsers and Node.js. Includes helpers for Mixpanel and Segment.com.", | ||
@@ -41,2 +41,3 @@ "directories": { | ||
"eslint-plugin-babel": "^5.3.1", | ||
"eslint-plugin-jest": "^24.3.6", | ||
"eslint-plugin-promise": "^5.1.0", | ||
@@ -58,3 +59,3 @@ "eslint-plugin-react": "^7.23.2", | ||
"build": "doctoc README.md --github --title '<h1>Table of Contents</h1>'; babel src --out-dir lib;", | ||
"format": "prettier --write **/*.{js,jsx}", | ||
"format": "prettier --write '**/*.{js,jsx}'", | ||
"format:check": "yarn format --check", | ||
@@ -61,0 +62,0 @@ "lint": "eslint --ignore-path .gitignore .", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79527
25