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.

Is onUpdate correct?

See original GitHub issue

We’re calling onUpdate not inside the if (shouldUpdate(node, oldNode)) { clause, but the one afterwards. Essentially, onUpdate will fire for every element when its props/attrs are updated, which is basically on every cycle. I am not sure if the current behavior makes sense.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
farismcommented, Mar 11, 2017

I think onUpdate should only fire inside shouldUpdate check, but right now shouldUpdate is not advanced enough (no deep checking on attr/props) to reliably fire onUpdate. Which makes me think that some type of immutability with cheap referential checking would be helpful.

The confusing part may be how it’s called shouldUpdate when it’s more along the lines of something like shouldRecreate? Or perhaps I’m reading it incorrectly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using OnUpdate correctly | WoWWiki - Fandom
This page is a guide on using OnUpdate correctly. The game engine will call your OnUpdate function once each frame. This is (in...
Read more >
onUpdate in MySQL means? - Stack Overflow
1 Answer 1 ... Cascade on update just means if you update the PK on the parent table, it'll update the child field....
Read more >
OnUpdate | InterSystems IRIS Data Platform 2022.2
OnUpdate - Specifies the action that this foreign key should cause in the current table when the key value of a record in...
Read more >
Method OnUpdate | Entities | 0.17.0-preview.42 - Unity - Manual
The Update() function evaluates whether a system should, in fact, update before calling OnUpdate() . The Entities.ForEach and Job.WithCode ...
Read more >
Difference between On Delete Cascade & On Update ...
ON UPDATE CASCADE ON DELETE CASCADE means that if you UPDATE OR DELETE the parent, the change is cascaded ... 3) is syntactically...
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