Skip to content

Conversation

@Bitshifter-9
Copy link

@Bitshifter-9 Bitshifter-9 commented Dec 2, 2025

Summary of Changes

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

Type of Change

  • 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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant