Comparing version 0.0.13 to 0.0.14
{ | ||
"name": "couillard", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "Couillard is a small trebuchet, you aim, and launch at your users.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -26,11 +26,7 @@ ![](https://badgen.net/bundlephobia/minzip/couillard) | ||
method: 'POST', | ||
..., | ||
body: metrics | ||
body: JSON.stringify(metrics) | ||
}) | ||
// Aim your experiment at your users. | ||
aim('welcome', 50, ['A', 'B'], saveMetrics) | ||
// Create variation A component. | ||
const WelcomeA = launch('welcome', 'A', saveMetrics, props => ( | ||
const WelcomeA = props => ( | ||
<p> | ||
@@ -40,6 +36,6 @@ Welcome I'm experiment A, {props.name}, | ||
</p> | ||
)) | ||
) | ||
// Create variation B component. | ||
const WelcomeB = launch('welcome', 'B', saveMetrics, props => ( | ||
const WelcomeB = props => ( | ||
<p> | ||
@@ -49,13 +45,22 @@ Welcome I'm experiment B, {props.name}, | ||
</p> | ||
)) | ||
) | ||
// Aim your experiment at your users. | ||
const Welcome = aim('welcome', 50, saveMetrics, { | ||
A: WelcomeA, | ||
B: WelcomeB | ||
}) | ||
// Only WelcomeA or WelcomeB will render. | ||
const Home = () => ( | ||
<div class={style.home}> | ||
<h1>Home</h1> | ||
<WelcomeA name="Jannette" /> | ||
<WelcomeB name="John" /> | ||
</div> | ||
) | ||
const Home = () => { | ||
launch('welcome', saveMetrics) | ||
return ( | ||
<div class={style.home}> | ||
<h1>Home</h1> | ||
<Welcome name="Jannette" /> | ||
</div> | ||
) | ||
} | ||
export Home | ||
@@ -62,0 +67,0 @@ ``` |
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
67
5192