Last active
October 22, 2015 18:54
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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