Hacker News new | ask | show | jobs
by UberMouse 553 days ago
`bar` is 2 because `setFoo` does not update the value of `foo` until the next render
1 comments

Will bar become 20 eventually? In the next cycle perhaps?

So there will be 3 cycles?

   1: foo = 1, next(foo = 10)
      bar = undef, next(bar = 2)
   2: foo = 10
      bar = 2, next(bar = 20)
   3: foo = 10
      bar = 20
Does the above sound right?