-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
fix(TreeData): Reset the childrens prop when unflattening dataset in case it is being reused #1675
fix(TreeData): Reset the childrens prop when unflattening dataset in case it is being reused #1675
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1675 +/- ##
========================================
- Coverage 99.8% 99.8% -0.0%
========================================
Files 187 187
Lines 31082 31080 -2
Branches 9786 9783 -3
========================================
- Hits 30993 30991 -2
Misses 89 89 ☔ View full report in Codecov by Sentry. |
inputArray.forEach((item: any) => all[item[identifierPropName]] = item); | ||
inputArray.forEach((item: any) => { | ||
all[item[identifierPropName]] = item; | ||
delete item[childrenPropName]; |
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.
the only thing I wonder is why are you deleting after and not before the assignment, so why not inverse lines 197 & 198 ? is it because the item[childrenPropName]
can contain children and you want to delete them from the item
?
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.
These lines are interchangeable without any affect on each other.
Line 197 maps the item reference under the set id field.
Line 198 removes the children property from the item.
I've added the line here as it was already a place where all items were iterated already.
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.
ok thanks, let's merge and hope this fixes it all :)
This is now release, but I even found another huge perf improvement via PR #1681 but of course I found it after I had already released everything lol 😆 So I'll wait a little before releasing this last perf, everything else is released. Thanks for the contribution. Cheers ⭐ |
fixes #1657 again
Recreate the children array from scratch everytime instead of entity lookups.
There were some lint errors which I had to fix to be able to commit this.