Skip to content

Commit ab0f8ec

Browse files
committed
feat(react-sizeme): Exposes new configuration option for react-sizeme.
The react-sizeme library now allows a refreshMode configuration option to be provided. This is now exposed via the component queries configuration.
1 parent 50fbbbb commit ab0f8ec

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,29 @@
4545
"compression": "1.6.2",
4646
"cz-conventional-changelog": "1.2.0",
4747
"enzyme": "2.4.1",
48-
"eslint": "3.4.0",
49-
"eslint-config-airbnb": "10.0.1",
48+
"eslint": "3.5.0",
49+
"eslint-config-airbnb": "11.1.0",
5050
"eslint-loader": "1.5.0",
5151
"eslint-plugin-import": "1.14.0",
52-
"eslint-plugin-jsx-a11y": "2.2.1",
52+
"eslint-plugin-jsx-a11y": "2.2.2",
5353
"eslint-plugin-mocha": "4.5.1",
5454
"eslint-plugin-react": "6.2.0",
5555
"express": "4.14.0",
5656
"ghooks": "1.3.2",
5757
"isparta": "4.0.0",
58-
"jsdom": "9.4.5",
58+
"jsdom": "9.5.0",
5959
"lodash-webpack-plugin": "0.10.0",
6060
"mocha": "3.0.2",
6161
"path": "0.12.7",
6262
"react": "15.3.1",
6363
"react-addons-test-utils": "15.3.1",
6464
"react-dom": "15.3.1",
65-
"react-sizeme": "2.1.3",
65+
"react-sizeme": "2.2.0",
6666
"semantic-release": "6.3.0",
6767
"sinon": "1.17.5",
6868
"stats-webpack-plugin": "0.4.2",
6969
"webpack": "1.13.2",
70-
"webpack-dev-middleware": "1.6.1",
70+
"webpack-dev-middleware": "1.7.0",
7171
"webpack-hot-middleware": "2.12.2"
7272
},
7373
"peerDependencies": {

src/componentQueries.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ function componentQueries(...params) {
4747
monitorHeight,
4848
monitorWidth,
4949
refreshRate,
50-
conflictResolver: _conflictResolver,
50+
refreshMode,
5151
} = params[0].config;
5252
sizeMeConfig = {
5353
monitorHeight: monitorHeight != null ? monitorHeight : defaultConfig.monitorHeight,
5454
monitorWidth: monitorWidth != null ? monitorWidth : defaultConfig.monitorWidth,
5555
refreshRate: refreshRate != null ? refreshRate : defaultConfig.refreshRate,
56-
conflictResolver: _conflictResolver,
56+
refreshMode: refreshMode != null ? refreshMode : defaultConfig.refreshMode,
5757
};
5858
}
5959
conflictResolver = conflictResolver || params[0].conflictResolver || defaultConflictResolver;
@@ -96,8 +96,8 @@ function componentQueries(...params) {
9696

9797
static propTypes = {
9898
size: PropTypes.shape({
99-
width: PropTypes.number,
100-
height: PropTypes.number,
99+
width: PropTypes.number, // eslint-disable-line react/no-unused-prop-types
100+
height: PropTypes.number, // eslint-disable-line react/no-unused-prop-types
101101
}).isRequired,
102102
};
103103

test/componentQueries.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describeWithDOM('Given the ComponentQueries library', () => {
1717
beforeEach(() => {
1818
sinonSandbox = sinon.sandbox.create();
1919

20-
sinonSandbox.stub(SizeMe, 'default', config => {
20+
sinonSandbox.stub(SizeMe, 'default', (config) => {
2121
sizeMeConfig = config; return x => x;
2222
});
2323

@@ -112,6 +112,7 @@ describeWithDOM('Given the ComponentQueries library', () => {
112112
monitorHeight: true,
113113
monitorWidth: false,
114114
refreshRate: 200,
115+
refreshMode: 'debounce',
115116
conflictResolver,
116117
},
117118
})(() => <div />);
@@ -120,7 +121,7 @@ describeWithDOM('Given the ComponentQueries library', () => {
120121
monitorHeight: true,
121122
monitorWidth: false,
122123
refreshRate: 200,
123-
conflictResolver,
124+
refreshMode: 'debounce',
124125
});
125126
});
126127
});

0 commit comments

Comments
 (0)