Skip to content

Instantly share code, notes, and snippets.

@rawls238
Last active October 22, 2015 18:54
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