Skip to content

Instantly share code, notes, and snippets.

@rawls238
Last active October 22, 2015 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rawls238/d70d7f09cb032123d62e to your computer and use it in GitHub Desktop.
Save rawls238/d70d7f09cb032123d62e to your computer and use it in GitHub Desktop.
class SignupExp extends PlanOut.Experiment {
//...other config
assign(params, args) {
params.set('signup_form_text', new PlanOut.Ops.Random.UniformChoice(choices=['Join Now', 'Sign up'], unit=userId));
params.set('signup_nav_text', new PlanOut.Ops.Random.UniformChoice(choices=['Welcome to the Future', 'This product is great'], unit=userId));
}
};
const exp = new SignupExp({userId: 'foo'});
const Parent = React.createClass({
render() {
return (
<Parametrize experiment={exp} params={['signup_form_text', 'signup_nav_text']}>
<SignupHeader />
<SignupForm />
</Parametrize>
);
}
});
const SignupHeader = withExperimentParams(React.createClass({
render() {
return (
<div>
{this.props.signup_nav_text}
</div>
);
}
});
const SignupForm = withExperimentParams(React.createClass({
render() {
return (
<div>
{this.props.signup_form_text}
</div>
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment