react-fractals
react-fractals copied to clipboard
Throttle update to only occur one at a time
By using the callback to setState
, updates are only run one at a time once the
previous update has completely finished (ie; fully flushed to the DOM, which can take longer than it takes for the next mousemove
event to fire).
Contrary to popular belief, setState
is not necessarily synchronous.