Refactored implementation of the fix from merge #56 #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been looking into the change from #56 and found a couple of issues with it:
apply
generic and passingdata
to it was excessive for a few reasons1.1. it is not used in the method in any way besides simply passing it back in the appropriate time.
1.2. passing it back in
updateData
is redundant anyway since you passupdateData
within the same call toapply
which means you have access to your data source, thus can update it with new data source you used to getdiff
in the first place.updateData
as optional with default value set tonil
kinda makes all these changes meaningless: if one forgets to passupdateData
closure it will effectively work as it did before.In the PR I've addressed these issues.
P.S. Also based on this I'd suggest avoiding incompatible API changes outside of major releases. (Thus making this particular change be released as
2.0.0
)