Skip to content

Commit 41afe75

Browse files
author
Guy
committed
parametrizeComponent -> parametrize
1 parent 845bfaf commit 41afe75

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Changes in 2.1
2-
- Added the ```parametrizeComponent``` function that takes in experiment information and a component and parametrizes the component with the experiment parameters as props.
2+
- Added the ```parametrize``` function that takes in experiment information and a component and parametrizes the component with the experiment parameters as props.
33
- Added the requirement to pass in an array of experiment parameters as props to the Parametrize component and removed the experimentName prop.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ This library serves as a way to declaratively implement UI experiments that are
2424
signupText = uniformChoice(choices=['Signup', 'Join now'])
2525
```
2626

27-
2) Wrap the component where you want to implement your UI experiment with the parametrizeComponent function provided by the library along with an instantiated experiment class and the specific parameter names that you want to parametrize the component with. As an example,
27+
2) Wrap the component where you want to implement your UI experiment with the parametrize function provided by the library along with an instantiated experiment class and the specific parameter names that you want to parametrize the component with. As an example,
2828

2929
```
30-
const Signup = parametrizeComponent(DummyExperiment, ['signupText'], React.createClass({
30+
const Signup = parametrize(DummyExperiment, ['signupText'], React.createClass({
3131
render() {
3232
return (
3333
<div>
@@ -47,7 +47,7 @@ To put it all together,
4747

4848
exp = new DummyExperiment({ id: 'this_is_the_user_id'});
4949

50-
let Signup = parametrizeComponent(exp, ['signupText'], React.createClass({
50+
let Signup = parametrize(exp, ['signupText'], React.createClass({
5151
render() {
5252
return (
5353
<div>
@@ -81,11 +81,11 @@ The implementation of all the components provided by this library are wrappers a
8181
8282
There are two primary higher-order components to use for parametrization.
8383
84-
**parametrizeComponent**: The ```parametrizeComponent``` function takes an instantiated experiment class, either an experiment name or a list of params, and a React component. It takes the given component and sets the deterministically and randomly assigned experiment parameters of the experiment class as props.
84+
**parametrize**: The ```parametrize``` function takes an instantiated experiment class, either an experiment name or a list of params, and a React component. It takes the given component and sets the deterministically and randomly assigned experiment parameters of the experiment class as props.
8585
86-
```parametrizeComponent(exp, ['signupText'], React.createClass({..}));```
86+
```parametrize(exp, ['signupText'], React.createClass({..}));```
8787
88-
**withExperimentParams**: The ```withExperimentParams``` function is used in combination with the base ```Parametrize``` component. It is useful when running an experiment with nested components, but generally the ```parametrizeComponent``` function should be preferred.
88+
**withExperimentParams**: The ```withExperimentParams``` function is used in combination with the base ```Parametrize``` component. It is useful when running an experiment with nested components, but generally the ```parametrize``` function should be preferred.
8989
9090
9191
```javascript

__tests__/testParametrize.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ describe('Test parametrize component', () => {
207207
});
208208

209209
it('should work with higher order component and list of params', () => {
210-
const Buttons = ReactExperiments.parametrizeComponent(exp, ['foo', 'test2'], React.createClass({
210+
const Buttons = ReactExperiments.parametrize(exp, ['foo', 'test2'], React.createClass({
211211
render() {
212212
return (
213213
<div>
@@ -247,7 +247,7 @@ describe('Test parametrize component', () => {
247247
});
248248

249249
it('should not log exposure if no valid params are passed', () => {
250-
const Test = ReactExperiments.parametrizeComponent(exp, ['foobar'], React.createClass({
250+
const Test = ReactExperiments.parametrize(exp, ['foobar'], React.createClass({
251251
render() {
252252
return (
253253
<div>

build/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import experimentClass from '../src/experimentClass';
33
import ABTest from '../src/abtest';
44
import Parametrize from '../src/parametrize';
55
import withExperimentParams from '../src/withExperimentParams';
6-
import parametrizeComponent from '../src/parametrizeComponent';
6+
import parametrize from '../src/parametrizeComponent';
77

88
export default {
99
ABTest: ABTest,
@@ -12,5 +12,5 @@ export default {
1212
experimentClass: experimentClass,
1313
Parametrize: Parametrize,
1414
withExperimentParams: withExperimentParams,
15-
parametrizeComponent: parametrizeComponent
15+
parametrize: parametrize
1616
};

dist/react-experiments.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ return /******/ (function(modules) { // webpackBootstrap
7070

7171
var withExperimentParams = _interopRequire(__webpack_require__(6));
7272

73-
var parametrizeComponent = _interopRequire(__webpack_require__(7));
73+
var parametrize = _interopRequire(__webpack_require__(7));
7474

7575
module.exports = {
7676
ABTest: ABTest,
@@ -79,7 +79,7 @@ return /******/ (function(modules) { // webpackBootstrap
7979
experimentClass: experimentClass,
8080
Parametrize: Parametrize,
8181
withExperimentParams: withExperimentParams,
82-
parametrizeComponent: parametrizeComponent
82+
parametrize: parametrize
8383
};
8484

8585
/***/ },

dist/react-experiments.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)