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.

Do not update when data is the same

See original GitHub issue

It would be good if update function could return previous data if changed variable is the same

i mean let a = {b: {c: {d : 5}}}; let z = update(a, {b: {c: {d : {$set: 5}}}); here ‘z’ changes even though value is the same. Right now i have a performance issue with react application, cause after update i receive new object most of the times with the same value as previous.

I believe Implementing this feature would speed up a react application

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
kolodnycommented, Jul 7, 2017

Hmm, I don’t want to default to a deepEqual. What about exposing an escape hatch for this? See 02243b7 for details.

1reaction
kolodnycommented, Jul 7, 2017

Hi danziamo. This currently works out of the box unless I’m misunderstanding what you’re referring to:

https://runkit.com/embed/yofw29ccbyeq

var update = require("immutability-helper")

let a = {b: {c: {d : 5}}};
let z = update(a, {b: {c: {d : {$set: 5}}}});
console.log(a === z) // true
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I get a formula to NOT update when I move some of ...
I built a simple budget spreadsheet that keeps track of my account balance. Currently, if I move the target data, the formula next...
Read more >
postgresql - Does updating a row with the same value actually ...
Due to the MVCC model of Postgres, and according to the rules of SQL, an UPDATE writes a new row version for every...
Read more >
Is SQL Server smart enough not to UPDATE if values are the ...
First, yes, an update does occur even if the value is the same. I created a test table with these columns: Key Value...
Read more >
UPDATE when the values are the same - SQLServerCentral
With Status = 0 added to the query it will actually update only recently added/processed records which have not been updated before.
Read more >
Data Sources Refreshing but Workbook Not Updating
For some reason, even though the data sources are updating, my actual workbook is not. It remains the same. Any ideas or suggestions...
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