-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Improve update of datasets to use correct dataset order #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@sjurba this PR will need to be rebased |
@benmccann: reabased onto master. |
src/index.js
Outdated
const current = | ||
currentDatasetsIndexed[this.props.datasetKeyProvider(next)]; | ||
if (current && current.type === next.type) { | ||
//The data array must be edited in place. As chart.js adds listeneres to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
listeneres -> listeners
src/index.js
Outdated
}); | ||
const { data, ...otherProps } = next; | ||
//Merge properties. Notice weekness here if a property is removed | ||
//from next, it will be retained by current and never dissapears. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dissapears -> disappears
src/index.js
Outdated
current.data[pid] = next.data[pid]; | ||
}); | ||
const { data, ...otherProps } = next; | ||
//Merge properties. Notice weekness here if a property is removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weekness -> weakness
src/index.js
Outdated
this.props.datasetKeyProvider | ||
); | ||
|
||
//We can safely replace the dataset array, as long as we retain the _meta property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should put a space after each //
for consistency with existing code
I read the first comment and thought: "spell checking comments.. A bit nitpicking maybe.." Then I read the second comment and was embarrassed. Then I read the third one. Sorry about that, and thank you for spell checking my comments. Fixed and amended. |
Thanks! I'll let @jerairrest review this PR since he's more familiar with the code. I just noticed those small issues |
Looks good to me! |
This fixes #226 by maintaining the order of the nextDatasets while merging the data from currentDatasets.
Fixes #226