Listen for user intent:
Prevent a function being called too many times, e.g. with "Throttle":
Stop the window resize event locking up the UI: