Skip to content

Commit 9635a1b

Browse files
committed
updated eslint
1 parent 939bcd4 commit 9635a1b

File tree

3 files changed

+13
-31
lines changed

3 files changed

+13
-31
lines changed

demo/yarn.lock

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,13 +2080,8 @@ hoek@2.x.x:
20802080
resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"
20812081

20822082
hoist-non-react-statics@^2.3.1:
2083-
<<<<<<< Updated upstream
2084-
version "2.3.1"
2085-
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.3.1.tgz#343db84c6018c650778898240135a1420ee22ce0"
2086-
=======
20872083
version "2.5.0"
20882084
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.0.tgz#d2ca2dfc19c5a91c5a6615ce8e564ef0347e2a40"
2089-
>>>>>>> Stashed changes
20902085

20912086
home-or-tmp@^2.0.0:
20922087
version "2.0.0"
@@ -2657,21 +2652,6 @@ minimist@^1.2.0:
26572652
dependencies:
26582653
minimist "0.0.8"
26592654

2660-
<<<<<<< Updated upstream
2661-
mobx-react-devtools@^4.2.15:
2662-
version "4.2.15"
2663-
resolved "https://registry.yarnpkg.com/mobx-react-devtools/-/mobx-react-devtools-4.2.15.tgz#881c038fb83db4dffd1e72bbaf5374d26b2fdebb"
2664-
2665-
mobx-react@^4.3.3:
2666-
version "4.3.3"
2667-
resolved "https://registry.yarnpkg.com/mobx-react/-/mobx-react-4.3.3.tgz#4ad76c03d1e942b431e942f9ea18df0756771655"
2668-
dependencies:
2669-
hoist-non-react-statics "^2.3.1"
2670-
2671-
mobx@^3.3.1:
2672-
version "3.3.1"
2673-
resolved "https://registry.yarnpkg.com/mobx/-/mobx-3.3.1.tgz#c38fc1a287a0dda3f5d4b85efe1137fedd9dcdf0"
2674-
=======
26752655
mobx-react-devtools@^5.0.1:
26762656
version "5.0.1"
26772657
resolved "https://registry.yarnpkg.com/mobx-react-devtools/-/mobx-react-devtools-5.0.1.tgz#9473c85929b2fc0c95086430419028cebd96fb3b"
@@ -2685,7 +2665,6 @@ mobx-react@^5.0.0:
26852665
mobx@4.2.0:
26862666
version "4.2.0"
26872667
resolved "https://registry.yarnpkg.com/mobx/-/mobx-4.2.0.tgz#ee0b0a4f3da2f4776225046ab208ac329a4841d4"
2688-
>>>>>>> Stashed changes
26892668

26902669
ms@0.7.1:
26912670
version "0.7.1"

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@
5353
"match-media-mock": "0.1.0"
5454
},
5555
"peerDependencies": {
56-
"mobx": "^4.0.0",
56+
"mobx": "^2.5.0 || ^3.0.0 || ^4.0.0",
5757
"prop-types": "^15.6.0",
5858
"react": "^15.0.0 || ^16.0.0"
5959
},
6060
"devDependencies": {
6161
"babel-cli": "6.22.0",
6262
"babel-core": "6.22.0",
63-
"babel-eslint": "7.1.1",
63+
"babel-eslint": "^8.2.3",
6464
"babel-loader": "6.2.10",
6565
"babel-plugin-add-module-exports": "0.2.1",
6666
"babel-plugin-transform-class-properties": "6.22.0",
@@ -76,11 +76,11 @@
7676
"cz-conventional-changelog": "1.2.0",
7777
"enzyme": "^3.1.0",
7878
"enzyme-adapter-react-16": "^1.0.1",
79-
"eslint": "3.13.1",
80-
"eslint-config-airbnb": "14.0.0",
81-
"eslint-plugin-import": "2.2.0",
82-
"eslint-plugin-jsx-a11y": "3.0.2",
83-
"eslint-plugin-react": "6.9.0",
79+
"eslint": "^4.19.1",
80+
"eslint-config-airbnb": "^16.1.0",
81+
"eslint-plugin-import": "^2.11.0",
82+
"eslint-plugin-jsx-a11y": "^6.0.3",
83+
"eslint-plugin-react": "^7.7.0",
8484
"husky": "^0.12.0",
8585
"jsdom": "^11.3.0",
8686
"json-loader": "0.5.4",

src/MatchMediaProvider.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
3-
import { toJS, set, action, runInAction } from 'mobx';
3+
import { toJS, extendObservable, set, action, runInAction } from 'mobx';
44
import { matchMedia, setMatchMediaConfig } from './matchMedia';
55

66
let breakpoints;
77

8-
export default class MatchMediaProvider extends Component {
8+
const setObservable = (observable, obj) => set
9+
? set(observable, obj)
10+
: extendObservable(observable, obj);
911

12+
export default class MatchMediaProvider extends Component {
1013
static propTypes = {
1114
children: PropTypes.node,
1215
breakpoints: PropTypes.object,
@@ -42,7 +45,7 @@ export default class MatchMediaProvider extends Component {
4245

4346
updateBreakpoints = action('update breakpoints', (key, val) => {
4447
const match = matchMedia(val).matches;
45-
set(this.props.breakpoints, { [key]: match });
48+
setObservable(this.props.breakpoints, { [key]: match });
4649
});
4750

4851
render() {

0 commit comments

Comments
 (0)