Batching changes made via Object.assign?
See original GitHub issueThank you for this excellent library.
My scenario is that Iām using Object.assign
, which is (correctly) invoking the callback for each implicit assignment. So if I have an object with two properties, the callback is invoked twice.
However, from the application standpoint, this is one change. Is there some way to detect this? Or group the changes? The argument to the callback is an array, but always appears to have just one value.
Iām guessing (I have not studied the code) that this is just a set trap which then invokes the callback. I donāt have any idea how you might group changes together. But I thought perhaps this might be something to which youāve given some thought. Is there a way to do this? If not, is there a good workaround?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Object.assign() - JavaScript - MDN Web Docs
The Object.assign() static method copies all enumerable own properties from one or more source objects to a target object.
Read more >I want to simplify (using Object.assign) a batch of JSON file
I recommend using a for-loop to iterate through an object you have parsed from the json (JS read json file and use as...
Read more >es6-object-assign examples - CodeSandbox
This function accepts an e object that contains fields used for batch update. The following is a summary of the steps you must...
Read more >Property attributes: an introduction ā¢ Deep JavaScript
Most properties are enumerable (e.g. those created via assignment or object literals), which is why you'll rarely notice this attribute in practice.
Read more >Static batching - Unity - Manual
Static batching is a draw call batching method that combines meshes that don't move to reduce draw calls. It transforms the combined meshes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
implemented in 3.2.0
Thanks for the response, Iāll start playing with the code around to see how it goes. š