Friday, February 17, 2023
1 change · master
Enhancements to existing features
This update replaces older timing code with a safer approach for handling animations. It helps prevent background animation tasks from continuing after a page component is closed, improving stability and reducing avoidable errors.
Original PR description
**Description of the issue/feature this PR addresses:** - The `throttle` function from `@web/core/utils/timing` is deprecated. - The `throttleForAnimation` function from `@web/core/utils/timing` has some unsafe usages in the code base. **Current behavior before PR:** Many of the usages of the `throttleForAnimation` util did not cancel the call to the throttled function when the using component is unmounted. **Desired behavior after PR is merged:** The `throttle` function is removed. A `useThrottleForAnimation` hook: - is introduced - is tested (as of the prior `useDebounced` hook which was not) - replace the `throttleForAnimation` usages.