refactor(stats): replace deprecated InteractionManager with requestIdleCallback #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/issue-4-replace-interactionmanager"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #4.
InteractionManageris deprecated in React Native 0.86 and logs the warning from the issue on every use. The only call site issrc/screens/StatsScreen.tsx, whererunAfterInteractionsdefers the per-interval stats aggregation off the interaction path.Change: swapped it for the global
requestIdleCallback/cancelIdleCallbackthat RN's deprecation notice points at. Both are polyfilled by RN in bridgeless and legacy modes, so no new dependency.A
{ timeout: 500 }option is passed because idle time is not guaranteed to arrive on a busy screen — without it the aggregation (and therefore the loading spinner) could stall indefinitely.runAfterInteractionshad no such failure mode, so the timeout keeps behaviour equivalent.The diff looks larger than it is: everything else is re-indentation from Prettier, since the callback is now nested one level deeper as an argument.
npm run checks:lint,checks:tscandchecks:formatall pass.🤖 Generated with Claude Code