Skip to content

Conversation

@ra1028
Copy link
Owner

@ra1028 ra1028 commented May 14, 2024

Pull Request Type

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

Description

Transitive refresh of dependent atoms in a custom refresh was found to cause multiple updates to be notified downstream due to updates of the parent atoms plus the update of self.
As a countermeasure, dependencies are temporarily detached during refresh to prevent update notifications and restored after refresh.

release(for: key)
}

func detachDependencies(for key: AtomKey) -> Set<AtomKey> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

aaah exactly what I wanted to ask (methods or closure to freeze updates to atom), thanks!

@ra1028 ra1028 merged commit d9a42ba into main May 14, 2024
@ra1028 ra1028 deleted the fix/custom-refresh branch May 14, 2024 03:58
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.

3 participants