Fixing eslint issues.

This commit is contained in:
Spencer Dellis
2017-05-19 11:11:33 -04:00
committed by GitHub
parent 5cc8f0a878
commit d49b06f92a

View File

@@ -29,17 +29,17 @@ module.exports = {
// Get new and old dataset keys // Get new and old dataset keys
const oldDatasetKeys = Object.keys(oldData.datasets[i]) const oldDatasetKeys = Object.keys(oldData.datasets[i])
const newDatasetKeys = Object.keys(dataset) const newDatasetKeys = Object.keys(dataset)
// Get keys that aren't present in the new data // Get keys that aren't present in the new data
const deletionKeys = oldDatasetKeys.filter((key) => { const deletionKeys = oldDatasetKeys.filter((key) => {
return key !== '_meta' && newDatasetKeys.indexOf(key) === -1 return key !== '_meta' && newDatasetKeys.indexOf(key) === -1
}) })
// Remove outdated key-value pairs // Remove outdated key-value pairs
deletionKeys.forEach((deletionKey) => { deletionKeys.forEach((deletionKey) => {
delete chart.data.datasets[i][deletionKey] delete chart.data.datasets[i][deletionKey]
}) })
// Update attributes individually to avoid re-rendering the entire chart // Update attributes individually to avoid re-rendering the entire chart
for (const attribute in dataset) { for (const attribute in dataset) {
if (dataset.hasOwnProperty(attribute)) { if (dataset.hasOwnProperty(attribute)) {