Skip to content

Commit

Permalink
Use object spread in lieu of object-assign
Browse files Browse the repository at this point in the history
  • Loading branch information
bregenspan committed Aug 31, 2017
1 parent bf72fb1 commit a02903b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
],
"plugins": [
"dynamic-import-webpack",
"transform-class-properties"
"transform-class-properties",
"transform-object-rest-spread"
]
}
8 changes: 5 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ module.exports = {
'parser': 'babel-eslint',
'plugins': [
'standard',
'promise'
'promise',
'prefer-object-spread'
],
'rules': {
'semi': ['error', 'always'],
'no-var': 'error'
'no-var': 'error',
'prefer-object-spread/prefer-object-spread': 2,
'semi': ['error', 'always']
}
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
"babel-loader": "^7.1.2",
"babel-plugin-dynamic-import-webpack": "^1.0.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.0",
"css-loader": "^0.28.6",
"debounce": "^1.0.2",
"eslint": "^4.5.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.1.1",
"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"extract-text-webpack-plugin": "^3.0.0",
Expand All @@ -37,7 +39,6 @@
"html-webpack-plugin": "^2.30.1",
"htmllint-loader": "^1.3.8",
"node-sass": "^4.5.3",
"object-assign": "^4.1.1",
"postcss-loader": "^2.0.6",
"sass-loader": "^6.0.6",
"style-loader": "^0.18.2",
Expand Down
6 changes: 2 additions & 4 deletions src/js/connector/polyline.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import objectAssign from 'object-assign'; // Object.assign is missing in e.g. IE11

// TODO: just use ES6 class...
const AnimatedPolyline = function (options) {
options = options || {};
Expand All @@ -8,9 +6,9 @@ const AnimatedPolyline = function (options) {
strokeStyle: '#f1dbce',
lineWidth: 4,
animated: true,
animateAmount: 4
animateAmount: 4,
...options
};
objectAssign(this.options, options);

this.finished = false;
this.segments = options.segments;
Expand Down

0 comments on commit a02903b

Please sign in to comment.