Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immutability #50

Merged
merged 4 commits into from
Jan 13, 2024
Merged

Immutability #50

merged 4 commits into from
Jan 13, 2024

Conversation

seldon1000
Copy link
Member

This PR introduces breaking changes for the Sun API.

  • Sun is now a struct: users can no longer use Sun as a reference type. However, immutability is not enforced and functions like setDate and setLocation are now defined as mutating.
  • Sun initializer now accepts a Date parameter (defaults to Date()).
  • Sun now conforms to Identifiable, Equatable, Hashable, and Sendable protocols.
  • Utilities such as Angle, DMS, EclipticCoordinates, EquatorialCoordinates, HMS, and HorizonCoordinates now conform to Equatable, Hashable, Sendable, and Codable protocols.

Conforming to these protocols makes many operations on instances of Sun much more efficient and easier, especially when using them along SwiftUI's native components.
… and HorizonCoordinates to Equatable and Hashable protocols
@davideilmito davideilmito merged commit 9179216 into main Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants