-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
chore: stream large lists diff #26
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99f333d
to
e56dec4
Compare
e56dec4
to
1b23b0e
Compare
1b23b0e
to
40a93e9
Compare
aeccae1
to
7fe7a84
Compare
60c2311
to
e34c291
Compare
e34c291
to
dc15ce9
Compare
87843ff
to
f613071
Compare
🎉 This PR is included in version 2.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
NEW FEATURE
streamListDiff()
Streams the diff of two object lists, ideal for large lists and maximum performance.
FORMAT
Input
prevList
: the original object list.nextList
: the new object list.referenceProperty
: a common property in all the objects of your lists (e.g.id
).options
chunksSize
the number of object diffs returned by each streamed chunk. (e.g.0
= 1 object diff by chunk,10
= 10 object diffs by chunk).showOnly
gives you the option to return only the values whose status you are interested in (e.g.["added", "equal"]
).considerMoveAsUpdate
: if set totrue
amoved
value will be considered asupdated
.Output
The objects diff are grouped in arrays - called
chunks
- and are consumed thanks to an event listener. You have access to 3 events:data
: to be notified when a new chunk of object diffs is available.finish
: to be notified when the stream is complete.error
: to be notified of an error during the stream.USAGE
Input
Output
ADDITIONAL FIXES
SWC
to speed up the tests.@models
,@lib
).README.md
.