Skip to content

Commit

Permalink
fix: remove requestIdleCallback in favor of requestAnimationFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
BowlingX committed Jun 4, 2024
1 parent 0a35176 commit 59875ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ export const converter =
thisState[ns].subscribers = thisState[ns].subscribers - 1
if (thisState[ns].subscribers === 0) {
// Delay the removal of subscribers, as we may have direct remounting components after
requestIdleCallback(() => {
requestAnimationFrame(() => {
;(set as GenericConverter<V, T>)((inner) => {
if (inner[ns]?.subscribers === 0) {
delete inner[ns]
Expand Down

0 comments on commit 59875ed

Please sign in to comment.