-
Notifications
You must be signed in to change notification settings - Fork 78
Favorite column modifies data source but should not interfere #540
Comments
Additionally the example binding is wrongfully called barista/libs/examples/src/table/table-favorite-column-example/table-favorite-column-example.html Line 5 in 5ffbd2c
Line 5 in 5ffbd2c
when the actual output is called
|
After a short investigation, this is what I have found: Here is what I would propose as a solution:
I would remove the modification of the original data. The modification of the original data is best handled by the consumer of the component library, as we cannot know if the data is mutable or not. They can react to the event and handle the modifications of their data accordingly. @yngrdyn I would really appreciate your input on this one. |
Hello @tomheller, I'll take a look in this |
Thank you @yngrdyn, you are brilliant 🎉 🤘 . |
Bug Report
Expected Behavior
Favorite column should not modify my data source.
Current Behavior
Modifies data by reference.
barista/components/table/src/simple-columns/favorite-column.ts
Line 64 in 5ffbd2c
Possible Solution
Hold favorite state in component itself.
Steps to Reproduce
When data in datasource is immutable this breaks.
Context (Environment)
Used Versions:
The text was updated successfully, but these errors were encountered: