Skip to content

Conversation

@ra1028
Copy link
Owner

@ra1028 ra1028 commented May 22, 2025

Pull Request Type

  • Bug fix
  • New feature
  • Refactoring
  • Documentation update
  • Chore

@ra1028 ra1028 marked this pull request as ready for review May 22, 2025 09:28
Copilot AI review requested due to automatic review settings May 22, 2025 09:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new pre-initialization lifecycle hook to MergedEffect so that each merged effect’s initializing method is called before the existing initialized, updated, and released hooks.

  • Introduces a private initializing closure property.
  • Updates the initializer to invoke each effect’s initializing method.
  • Adds a public initializing(context:) method with documentation.

/// A lifecycle event that is triggered before the atom is first used and initialized,
/// or once it is released and re-initialized.
public func initializing(context: Context) {
initializing(context)
Copy link

Copilot AI May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call to initializing(context) inside public func initializing refers to the method itself, causing infinite recursion. Rename the private closure property (e.g., to _initializing or initializingHandler) or adjust the call to disambiguate the closure (for example self._initializing(context)).

Suggested change
initializing(context)
_initializing(context)

Copilot uses AI. Check for mistakes.
@ra1028 ra1028 merged commit 4efc094 into main May 22, 2025
6 checks passed
@ra1028 ra1028 deleted the merged-effect-initializing-effect branch May 22, 2025 09:42
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.

2 participants