Skip to content

Commit

Permalink
updating eslint; import for lodash instead of sub-libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
Inbal-Tish committed Jul 25, 2019
1 parent a88b4f8 commit 1139474
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,9 @@

## [1.200.0] - 2019-07-18
### Added
- Calendar knob - added testID
- Calendar knob - added testID.

## [1.202.0] - 2019-07-25
### Change
- eslint - updating to version 6.1.0.
- lodash - importing library instead of sub-libraries.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
"author": "Wix.com",
"license": "MIT",
"dependencies": {
"lodash.get": "^4.4.2",
"lodash.isequal": "^4.5.0",
"lodash": "^4.0.0",
"prop-types": "^15.5.10",
"xdate": "^0.8.0"
},
"devDependencies": {
"babel-eslint": "^7.2.3",
"eslint": "^3.19.0",
"eslint": "^6.1.0",
"eslint-plugin-react": "^7.0.0",
"jasmine": "^2.5.2",
"semver": "5.x.x",
Expand Down
6 changes: 3 additions & 3 deletions src/calendar/day/period/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, {Component} from 'react';
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, {Component} from 'react';
import {
TouchableWithoutFeedback,
Text,
View} from 'react-native';
import {shouldUpdate} from '../../../component-updater';
import isEqual from 'lodash.isequal';

import * as defaultStyle from '../../../style';
import styleConstructor from './style';
Expand Down Expand Up @@ -48,7 +48,7 @@ class Day extends Component {
shouldComponentUpdate(nextProps) {
const newMarkingStyle = this.getDrawingStyle(nextProps.marking);

if (!isEqual(this.markingStyle, newMarkingStyle)) {
if (!_.isEqual(this.markingStyle, newMarkingStyle)) {
this.markingStyle = newMarkingStyle;
return true;
}
Expand Down
5 changes: 2 additions & 3 deletions src/component-updater.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
const get = require('lodash.get');
const isEqual = require('lodash.isequal');
const _ = require('lodash');

function shouldUpdate(a, b, paths) {
for (let i = 0; i < paths.length; i++) {
const equals = isEqual(get(a, paths[i]), get(b, paths[i]));
const equals = _.isEqual(_.get(a, paths[i]), _.get(b, paths[i]));
if (!equals) {
return true;
}
Expand Down

0 comments on commit 1139474

Please sign in to comment.