-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(hooks): fix issues with excessive number of pending callbacks (#1686
) * chore(hooks): refactor hooks - in usePlaybackState avoid possible race condition where setPlayerState could override the value received from the event listener by using callback version of setState by only setting if initial state is still missing - useProgress: the useProgress hook can overload slow systems because a setInterval loop is used without waiting for the results in between (see #1355) – this pr makes sure only one call is in the air at a time - useProgress: simplify the logic used to avoid updating state when progress hasn’t changed by using callback style of setState - replace isMountedRef usgae with inline ‘mounted’ variables * chore(hooks): fix type * chore(hooks): use arrow functions in effect
- Loading branch information
Showing
1 changed file
with
52 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters