vue icon indicating copy to clipboard operation
vue copied to clipboard

fix(scheduler): add missing type annotation to callActivatedHooks

Open Bitshifter-9 opened this issue 1 month ago • 0 comments

Summary of Changes

Added Component[] type annotation to the queue parameter in the callActivatedHooks function within src/core/observer/scheduler.ts.

Type of Change

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Refactor (code change that neither fixes a bug nor adds a feature)

The Problem

The callActivatedHooks function lacked a type annotation for its queue parameter, unlike other similar functions in the scheduler (e.g., callUpdatedHooks). This inconsistency reduced type safety and code clarity, potentially allowing incorrect types to be passed during development.

The Solution

Explicitly typed the queue parameter as Component[]. This aligns with the activatedChildren array type (which is passed to this function) and matches the pattern used in other scheduler hook functions, improving overall code consistency and type safety.

Testing

  • [x] Ran npm run ts-check to verify no type errors were introduced.
  • [x] Ran npm test -- test/unit/modules/observer/scheduler.spec.ts to ensure scheduler logic remains intact.
  • [x] Verified that activatedChildren is defined as Array<Component>, confirming Component[] is the correct type.

Bitshifter-9 avatar Dec 02 '25 04:12 Bitshifter-9