question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Batching changes made via Object.assign?

See original GitHub issue

Thank 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:closed
  • Created 3 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
gulleryacommented, Sep 3, 2020

implemented in 3.2.0

1reaction
gulleryacommented, Aug 24, 2020

Thanks for the response, Iā€™ll start playing with the code around to see how it goes. šŸ‘

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found